Hey.
I am trying to find a way (if it is even possible) to search a long string from a textarea box for certain words. Then I want to break them down and replace them. The problem is I don't know what the text will be ahead of time. I only know my identifiers of two number signs (#thetext#).
I tried to use ereg and str_replace combo to strip the text out from twixt the ##'s but I can't seem to get it to work.
Any help would be greatly appreciated.
Example of code I mean :
$text is the textarea
ereg("#thisisthetextIamlookingfor#", "thisisthetextIamlookingfor", $text)
$foundtext = original text //"#thisisthetextIamlookingfor#"
$newtext = middlepartof original text //"thisisthetextIamlookingfor"
str_replace("$foundtext", "$newtext", $text)
//End of Example
Again, I know that is probably very very wrong code but I wanted to make it simple for you guys to see what I am trying.
Thanks in advance.