I have a piece of text, and I want to replace every word for example "car" with car and a number so: "car1", "car2", "car3" etc with PHP
I tried using str_replace(); but to no avail.
<?php
$text='yadadyayayay car yayayaya car aksdkjasd car car car car car car car';
$output=str_replace('car','car'.$count,$text,$count);
echo $output;
?>
I come to think str_replace() may not be the right approach.
Thank you very much.
Here is my solution
This will output