Posted By

misteroneill on 09/01/09


Tagged

regex parse String new lines


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

umang_nine


Check for New Lines


 / Published in: PHP
 

URL: http://www.misteroneill.com

This function simply returns a Boolean value to determine whether or not a string containers new line characters. Useful in cleaning data.

  1. function has_new_lines($input) {
  2. return preg_match("/(%0A|%0D|\n+|\r+)/i", $input);
  3. }

Report this snippet  

You need to login to post a comment.