Re: highlight_string()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/03/06, Weber Sites LTD <berber@xxxxxxxxxxxxxxx> wrote:> Hi>> I'm trying to go with your idea but I'm having difficulties with> preg_match_all.> I want the text between <?php and ?>. The use of preg_match_all bellow only> Returns text that is in a single line. If the <php is on one line and the ?>> is> A few lines bellow, it does not match.>> preg_match_all('/<\?php(.*?)\?>/i',$text,$CodeArray,PREG_PATTERN_ORDER);>
By default a '.' matches any character except for a newline. If youwant it to match *everything* you have to use the 's' pattern modifier- just stick an 's' on the very end of your pattern, after the 'i'.
   /<\?php(.*?)\?>/is
  -robin

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux