greenbug2002
asked on
Replace a match opccurance in a string only once vith php4
hi i have the following:
$replaceing = array("<td bordercolor=\"#000000\">$p name</td>" );
$replaceing2 = array("<td bordercolor=\"#000000\"col span=\"$co unt\" ><div align=\"center\">$pname</d iv></td>") ;
$table = str_replace($replaceing, $replaceing2, $table);
which replaces all found instances in $table but i need to only replace the first instance but i am stuck on php4
please help
$replaceing = array("<td bordercolor=\"#000000\">$p
$replaceing2 = array("<td bordercolor=\"#000000\"col
$table = str_replace($replaceing, $replaceing2, $table);
which replaces all found instances in $table but i need to only replace the first instance but i am stuck on php4
please help
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Please have a look at : http://www.help2go.com/Tutorials/Programming/PHP_:_How_to_replace_only_the_first_occurrence_in_a_string_with_str%11replace.html
Hope this helps
Best regards