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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.