Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem z preg_replace, Zamiana zlapanej wartosci na wartosc z tablicy.
Kirtan Loor
post 22.07.2006, 19:39:30
Post #1





Grupa: Zarejestrowani
Postów: 44
Pomógł: 0
Dołączył: 22.10.2004
Skąd: Płock

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


Witam.
Mam problem z preg_replace:

  1. <?php
  2.  
  3. private function bb_images()
  4. {
  5. $var = array("n"=>"news", "enc"=>"encyklopedia");
  6. $this->text = preg_replace('#[img:(.+?)="(.+?)"]#si', '<img src="/uploads/'.$var["1"].'/'."2".'" alt="obrazek" style="padding:5px;" />', $this->text);
  7. $this->text = preg_replace('#[img:(.+?)="(.+?)" s="(.+?)"]#si', '<img src="/uploads/'.$var["1"].'/'."2".'" alt="obrazek" style="padding:5px;float:'."3".'" />', $this->text);
  8. }
  9.  
  10.  
  11. ?>


Jak zrobić, by zamienić ciąg znaków ("\\1") na przypisane mu dane z tablicy?

Ten post edytował Kirtan Loor 22.07.2006, 19:45:50


--------------------
A Chartreux et à Célestins, A Mendiants et à Dévotes,
A musards et claquepatins, A servants et filles mignottes
Portants surcots et justes cottes,A cuidereaux d'amour transis,
Chaussant sans méhaing fauves bottes, Je crie à toutes gens mercis.
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 - 19:07