Hi I have a string replace:
$sHTML = str_replace( "[+fs.area.'{$member[ "town" ]}'+]", hello", $sHTML );
I have multiple towns in the database and i cannot go adding static short codes for each town as the user maybe adding towns later, i basically want to put into the html:
[+fs.area.townname+] which in this case will show hello am i doing something wrong or is there another way i can go about it?
This is not wordpress, i did some searching and found there was a way to do it in wordpress but thats not what i want.
But I think you want to create key/value table
key: +fs.area.glasgow+
value: Glasgow
key: +fs.area.Glasgowe+
value: Glasgow
and you want to select record from table for key and replace occurence with value in string.