I'll get right to it. I am trying to make this;
there was a man called [fred].
Trying to make that, into this:
there was a man called <a href = "fred">fred</a>.
Here is what I have so far, I am not doing too well.
$peices = explode(" ", $page_content);
$new_page_content = "";
while ($i < sizeof($peices)) {
$block = $peices[$i];
if ($block[0] == "[") {
$last = $block{strlen($block)-1};
if ($last == "]") {
echo " found a link !!";
$block[$i] = str_replace("[" , "linkbegin::[" , $block);
$block[$i] = str_replace("]" , "]linkend::" , $block);
}
}
$new_page_content .= $block[$i];
$i++;
}
echo $page_content;
I've substituted the wanted html, with some other random text, just for the hell of it, I dont know why.
Many thanks for any help, in advance.