Mega Code Archive

 
Categories / Php / Strings
 

The m modifier to change the behavior of $

<? $text = "Name: matt\noccupation: coder\neyes: blue\n"; preg_match_all( "/^\w+:\s+(.*)$/m", $text, $array ); foreach ( $array[1] as $val ) {     print "$val<br>"; } ?>