minte9
LearnRemember



Replace

Replaces all occurrences of the search string with the replacement string.
 
echo str_replace("EN ", "RO ", 
            "EN dictionary for En class"); 
                        // RO dictionary for En class
echo str_ireplace("EN ", "RO ", 
            "EN dictionary for En class", $count);
                        // $count = 2

Translate

Translates characters or replace substrings.
 
echo strtr("baab", "ab", "01"); // 1001
echo strtr("This is America", array('This'=>'Acesta', 'is'=>'e')); 
    // Acesta e America

Substring

Returns: string OR array
 
echo substr_replace("123456", "a", 0); // a
echo substr_replace("123456", "a", 2); // 12a
echo substr_replace("123456", "a", -1); // 12345a
echo substr_replace("123456", "a", -2); // 1234a
echo substr_replace("123456", "a", 0, 2); // a3456
echo substr_replace("123456", "a", 0, -2); // a56
echo substr_replace("123456", "a", 0, 0); // a23456



  Last update: 432 days ago