Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] emotikony a str_replace
bahh
post 3.12.2014, 12:09:37
Post #1





Grupa: Zarejestrowani
Postów: 261
Pomógł: 2
Dołączył: 13.05.2012

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


Mam funkcję do emotikon:

  1. function emoticons($string)
  2. {
  3. str_replace(':)','<img src="images/emoticons/smile.png" alt="" />',$string);
  4. str_replace(':(','<img src="images/emoticons/angry.png" alt="" />',$string);
  5. str_replace(';)','<img src="images/emoticons/wink.png" alt="" />',$string);
  6. str_replace(';(','<img src="images/emoticons/cry.png" alt="" />',$string);
  7. return $string;
  8. }


jednakże jak występuje string typu bla bla bla smile.gif to nie podmienia na <img src="...">

co jest nie tak?
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 09:58