Little River Software
Home -> Articles -> String Vs Array
Little River Software - Custom PHP Software Design and Programming
The ASP Method

The ASP to PHP Comparison

The PHP Method

The original string based method of handling a replace on a string of data.

' $strTmp is a string filled with a lot of data
$strTmp = str_replace("1add","ADD",$strTmp);

The new array based method of handling a replace on a string of data.

'$arrTmp is an array filled with fragments of $strTmp
foreach ($arrTmp as $key=>$value)
{
$arrTmp [$key] = str_replace("1add","ADD",$value) ;
}

The ASP Method

The ASP to PHP Comparison