Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]zastąpienie ereg
shreker
post
Post #1





Grupa: Zarejestrowani
Postów: 270
Pomógł: 0
Dołączył: 21.05.2008

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


chcialem zastąpić ereg na preg_replace
  1. $phpinfo = ob_get_contents();
  2. $phpinfo = str_replace('border: 0px', '', $phpinfo);
  3. ereg('<body>(.*)</body>', $phpinfo, $regs);
  4. echo '<table border="0" cellpadding="3" width="600px" style="border: 0px; border-color: #000000;"><tr><td>'.$regs[1].'</td></tr></table>';

w powyzszej wersji dziala bez problemu, ale w tej
  1. preg_match('#<body>(.*)</body>#', $phpinfo, $regs);

wywala blad : E_NOTICE : Undefined offset: 1 FILE : ....

Ten post edytował shreker 20.05.2012, 23:50:31
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: 19.09.2025 - 02:56