treeleaf20
03-11-2010, 02:07 AM
All,
I have the follwing in a text string:
<link>construction<endlink>
I'd like to be able to search this in a string and basically find the word/words inbetween <link> and <endlink> and make it an actual link, so:
<a href="construction.php">construction</a>
Also, there could be multiple of these in a string. Any ideas?? I also have the following code:
$txt = $resultsettxt['text'];
$newtxt = str_replace("<endbullet><bullet>", "</li><li>", $txt);
$newtxt = str_replace("<bullet>", "<li>", $txt);
$newtxt = str_replace("<endbullet>", "</li><br>", $newtxt);
$newtxt = str_replace("<bold>", "<strong>", $newtxt);
$newtxt = str_replace("<endbold>", "</strong>", $newtxt);
echo nl2br($newtxt);
Which works good and want to continue to use this so if there is a way to incorporate this with the <link> then I'm open to ideas.
Thanks in advance!
I have the follwing in a text string:
<link>construction<endlink>
I'd like to be able to search this in a string and basically find the word/words inbetween <link> and <endlink> and make it an actual link, so:
<a href="construction.php">construction</a>
Also, there could be multiple of these in a string. Any ideas?? I also have the following code:
$txt = $resultsettxt['text'];
$newtxt = str_replace("<endbullet><bullet>", "</li><li>", $txt);
$newtxt = str_replace("<bullet>", "<li>", $txt);
$newtxt = str_replace("<endbullet>", "</li><br>", $newtxt);
$newtxt = str_replace("<bold>", "<strong>", $newtxt);
$newtxt = str_replace("<endbold>", "</strong>", $newtxt);
echo nl2br($newtxt);
Which works good and want to continue to use this so if there is a way to incorporate this with the <link> then I'm open to ideas.
Thanks in advance!