Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Preg match i replace - używanie zmiennej w replace
tosiek
post
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
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 2.10.2025 - 17:47