
04-19-06, 02:35 AM
|
 |
Newbie Coder
|
|
Join Date: May 2005
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
replacing...
|

04-19-06, 03:03 AM
|
|
Wannabe Coder
|
|
Join Date: Aug 2004
Location: Sverige
Posts: 124
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
Last edited by Wuiqed; 04-19-06 at 03:09 AM.
|

04-19-06, 03:08 AM
|
 |
Community Leader
|
|
Join Date: Sep 2005
Location: Spain
Posts: 8,074
Thanks: 11
Thanked 88 Times in 83 Posts
|
|
|
|

04-19-06, 03:09 AM
|
 |
Newbie Coder
|
|
Join Date: May 2005
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
hi, thanks. i've try the script before. but it's not effective. more effective way?
Quote:
|
Originally Posted by Wuiqed
|
|

04-19-06, 03:13 AM
|
|
Wannabe Coder
|
|
Join Date: Aug 2004
Location: Sverige
Posts: 124
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Not effective? How did you come to that conclusion?
|

04-19-06, 03:34 AM
|
 |
Community VIP
|
|
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Actually, both of the above will work with a minor correction. The str_replace does not modify the source, but instead returns a result. The following is needed -
Here is a third way that keeps the original form of the $smilies array -
Yah I know, it could probably use the addition of the alt text...
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Last edited by mab; 04-19-06 at 03:40 AM.
|

04-19-06, 03:51 AM
|
 |
Newbie Coder
|
|
Join Date: May 2005
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
thanks.... :)
hi, thanks friends......
it's works....
i've modified ....
thanks to nico_swd for:
Quote:
|
str_replace(array_keys($smilies), array_values($smilies), $data[3]);
|
thanks to Wuiqed for:
Quote:
//notice that I changed your mysql_num_rows() to mysql_fetch_array()
//this is because mysql_num_rows() only returns HOW MANY rows was
//fetched but doesn't return the actual rows
|
now the script like below:
Last edited by qie; 04-19-06 at 03:53 AM.
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|