Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Preg match i replace - używanie zmiennej w replace
tosiek
post 20.03.2009, 20:08:02
Post #1





Grupa: Zarejestrowani
Postów: 142
Pomógł: 0
Dołączył: 7.07.2008

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


Witam. Mam błahy problem z preg match i replace:

  1. <?php
  2. $cks_file2 = preg_match("/bb0100c15b_data    (.*)/", $cks_file, $cks_file_data);
  3. $cks_file2 = preg_replace("/".$cks_file_data[1]."/", $cks_data3, $cks_file);
  4. $cks_file3 = preg_match("/bb0100c15b_sid    (.*)/", $cks_file2, $cks_file_data2);
  5. $cks_file3 = preg_replace("/".$cks_file_data2[1]."/", $cks_sid, $cks_file2);
  6. ?>


I mam problem z dodaniem do zmiennej z preg match przed zmienną / i po /.
I dziwne rzecz po zmianie za pomocą preg replace ucina resztę pliku, też nie wiem czemu ;/


--------------------
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: 23.06.2025 - 19:32