Jump to content

should i use 'str_ireplace' and how?


RCB

Recommended Posts

hey guys i have a question..

 

im creating a external display for my forums shoutbox, im looking to replace  a certain part of the return if needed but im unsure how to do it...

 

 

this is my code so far

 

            $ipbwi->DB->allow_sub_select=1;

                        $result = $ipbwi->DB->query("
          SELECT *
          FROM ibf_d22shoutbox_shouts s
          ORDER BY s_id DESC
          LIMIT 6
                    ");

    while ($r = $ipbwi->DB->fetch_row($result)) {   
       
         $m    = $ipbwi->member->info($r[s_mid]);
         $g    = $ipbwi->group->info($m[g_id]);
         $date = date("D. jS - g:i a", $r['s_date']);
         $shouts .= ''.$date.' '.$g['prefix'].$m['members_display_name'].$g['suffix'].'  '.$r['s_message'].'<br />';

   }

 

if someone posts a emoticon it will come back  with 

<img src="style_emoticons/<#EMO_DIR#>/tongue.gif" alt="tongue.gif" />

what i need is it replace  the

<#EMO_DIR#>
with the actual path.. im not sure how to do this i assume i need to use 'str_ireplace'  something like 

 

str_ireplace("<#EMO_DIR#>", "images", "<img src='style_emoticons/<#EMO_DIR#>/tongue.gif' alt='tongue.gif' />");

  im not sure how to implement it my current code if someone can help that would be great thx

 

cheers

RCB

 

Link to comment
https://forums.phpfreaks.com/topic/145924-should-i-use-str_ireplace-and-how/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.