PHP Function: Built-in Functions part 10

Regular Expression Functions 

ereg_replace() and eregi_replace() 
The ereg_replace() and eregi_replace() functions replace instances of a pattern within a string and return the new string. The ereg_replace() function performs a clase-sensitive match, and eregi_replace() performs a case-insensitive match. Here is the syntax for both functions:

For example, you would use the following code to replace “ASP” with “PHP” in the string “I really love programming in ASP”:

If “ASP” is mixed case, such as “aSp”, use the eregi_replace() function:

The split() function splits a string into an array using a certain separator (comma, colon, semicolon, and so on). Its syntax is

split(pattern, string, [limit]);

If limit is specified, the split() function stops at the named position–for example, at the tenth value in a common-delimited list. Next php function: Built-in Functions part 11