Jump to content

Still trying to get this to work


rkm140

Recommended Posts

Thanks for the code yesterday it made things a lot simpler, however i am stilling having issue with it.

 

1. if a text post that doesn't include [ ] has ad in it it will post the image. I am trying to get to only post the image for the letter combination and number combination within [ ].

 

2. below is a screen shot of what is going on. it will post image sometimes and sometimes it wont

 

 

$cards = array('2','3','4','5','6','7','8','9','T','J','Q','K','A');
$suits = array ('c','d','h','s');

$fromArray = $toArray = array();
foreach($cards as $card) {
   foreach($suits as $suit) {
      $word[] = '['.$card.$suit;
      $word[] = $card.$suit.']';
      $word[] = ' '.$card.$suit.' ';
      $link[] = '[<img src="http://mypokerrails.com/forum1/cards/'.$card.$suit.'.png">';
      $link[] = '<img src="http://mypokerrails.com/forum1/cards/'.$card.$suit.'.png">]';
      $link[] = '<img src="http://mypokerrails.com/forum1/cards/'.$card.$suit.'.png">';
   }
}
$this->post['message'] = str_ireplace($word, $link, $this->post['message']);

 

 

testmnu.png

Link to comment
https://forums.phpfreaks.com/topic/175357-still-trying-to-get-this-to-work/
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.