In php, how can I perform a replace only in the first 3 characters in a string?
So:
$str = /pr/printers
Replace 'pr' with 'or'. So its -> /or/printers.
What’s happening to me is, the pr in the printer is being replaced as well. So I’m ending up with /or/orinters. How can this be done?
$new = str_replace(‘/pr/’, ‘/or/’, ‘/pr/printers’);
You can also use regular expressions like this:
http://www.laprbass.com/RAY_temp_norman.php