Re: eregi_replace() problems
| From: | David Robley | Date: | Fri, 30 Aug 2002 04:42:05 +0000 |
| Subject: | Re: eregi_replace() problems | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-114592@lists.php.net to get a copy of this message | ||
In article <20020829222207.77380.qmail@pb1.pair.com>,
tonyh21@tharrison21.fsnet.co.uk says...
> Can anyone tell me why my emoticons arent appearing? Please?
>
> Note: $message is a variable set by a web form. The field
>
pattern is the
> string to search for, like ":-)", and url is the
> relative url to the
> emoticon. I just get the plain emoticon. Note: this bit is above the INSERT
> statement in the script.
> <?php
>
> $emotes = mysql_query("SELECT
> pattern,url FROM
> emoticons");
> for ($t = 0; $t < mysql_num_rows($emotes); $t ++) {
> $emotes_array = mysql_fetch_row($emotes);
> eregi_replace($emotes_array[0], "<img src=\"emoticons/$emotes_array[1]\"
> alt=\"$emotes_array[0]\">", $message);
> }
>
> ?>
Shouldn't you be assigning the result of your eregi_replace to a variable,
then do something with it?
--
David Robley
Temporary Kiwi!
Quod subigo farinam