For some reason i’m getting an unexpected “[” in the below line of code. I’m not an expert at php so it could be something simple and i’m not seeing it.
<span class=\"url\"> ". ereg_replace("[","",$ads]['ad_url'][$idx]) ."</span> ".$ads['ad_desc'][$idx] ."</div>
Thxs for the help in advance
I’m now getting the error Parse error: syntax error, unexpected T_STRING after updating the a partial part of the code above to
preg_replace("/[/","",$ads['ad_url'][$idx])
Any ideas?
EDIT:
Here is the full updated code
<span class=\"url\"> ".a ereg_replace("\[","",$ads['ad_url'][$idx]) ."</span> ".$ads['ad_desc'][$idx] .</div>v>
Put a slash before [ in ereg param .. and replace ereg_replace with preg_replace (ereg is deprecated) then remove the ] after $ads like this:
better:
preg_replace(“/\[/”,””,$ads[‘ad_url’][$idx])