Joyride Posted February 16, 2007 Report Share Posted February 16, 2007 Sis kods: preg_match_all('<!-- INCLUDE (.*) -->', $this->html, $matches); echo '<pre>'; print_r($matches); echo '</pre>'; atgriez: Array ( [0] => Array ( [0] => !-- INCLUDE header.html -- [1] => !-- INCLUDE footer.html -- ) [1] => Array ( [0] => header.html [1] => footer.html ) ) Kas ir japamaina, lai Array[0][...] vertibam butu ari klat < > iekavas? Pats par sevi, parsets tiek html kods. Link to comment Share on other sites More sharing options...
rpr Posted February 16, 2007 Report Share Posted February 16, 2007 izmanto atdaliitaajus (delimiters). jo pregs shajaa gadiijumaa izmanto <> kaa atdaliitaajus. izmanto piemeeram / vai # ziimes. preg_match_all('/<!-- INCLUDE (.*) -->/', $this->html, $matches); Link to comment Share on other sites More sharing options...
Joyride Posted February 16, 2007 Author Report Share Posted February 16, 2007 Mana vaina, tikko pieleca, bet paldies sa vai ta! Link to comment Share on other sites More sharing options...
Joyride Posted February 16, 2007 Author Report Share Posted February 16, 2007 Viena nepilniba atradas - ja kods ir sads: <p><!-- INCLUDE footer --></p><p><!-- INCLUDE footer --></p> tad nepareizi tiek izvadits rezultats: Array ( [0] => Array ( [0] => <!-- INCLUDE footer --></p><p><!-- INCLUDE footer --> ) [1] => Array ( [0] => footer --></p><p><!-- INCLUDE footer ) ) RegExus vel tikai macos, tapec soreiz pats netieku gala. Link to comment Share on other sites More sharing options...
andrisp Posted February 16, 2007 Report Share Posted February 16, 2007 /<!-- INCLUDE (.*?) -->/ Link to comment Share on other sites More sharing options...
Joyride Posted February 16, 2007 Author Report Share Posted February 16, 2007 Paaaldies! Link to comment Share on other sites More sharing options...
Recommended Posts