Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Jak zamienić tekst na obrazowe emotikony?
Saki
post
Post #1





Grupa: Zarejestrowani
Postów: 240
Pomógł: 2
Dołączył: 5.12.2010
Skąd: Fulda

Ostrzeżenie: (0%)
-----


Witam, zrobiłem funkcje emotikony, ale nie działa ona do końca poprawnie, chciałbym aby z tekstu np:

"Cześć jak się masz mxder? (IMG:style_emoticons/default/smile.gif) " Zamieniło na: "Cześć jak się masz mxder? EMOTIKONA"
A w rzeczywistości zamienia na "Cześć jak się masz mEMOTIKONAer? EMOTIKONA"

  1. function emotkikony($text) {
  2. $emotikony = array(
  3. '(IMG:style_emoticons/default/tongue.gif) ' => 'emoty/psmile.gif',
  4. '(IMG:style_emoticons/default/haha.gif) ' => 'emoty/lol.gif',
  5. '(IMG:style_emoticons/default/haha.gif) ' => 'emoty/lol.gif',
  6. '(IMG:style_emoticons/default/haha.gif) ' => 'emoty/lol.gif',
  7. '(IMG:style_emoticons/default/tongue.gif) ' => 'emoty/psmile.gif'
  8. );
  9.  
  10. foreach($emotikony as $tekst => $grafika) {
  11. //$text = str_replace($tekst,'<img src="'.$grafika.'" />',$text);
  12. $text = str_ireplace($tekst,'<img src="'.$grafika.'" />',$text);
  13. }
  14.  
  15. return $text;
  16. }
  17.  


Jak sami widzicie na tym forum nie ma tego błędu.

Ten post edytował Saki 16.08.2012, 21:40:57
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 4.10.2025 - 19:13