error in code "check is email after split "
<p>this is the code </p>

<pre><code>&lt;?php
function is_email($input) {
  $email_pattern = "/^([a-zA-Z0-9\-\_\.]{1,})+@+([a-zA-Z0-9\-\_\.]{1,})+\.+([a-z]{2,4})$/i";
  if(preg_match($email_pattern, $input)) return TRUE;

}
$emails = "xx@xx.com
xx@xx.com
xx@xx.com
xx@xx.com
xx@xx.com
xx@xx.com
xx@xx.com
xx@xx.com
xx@xx.com
xx@xx.com
xx@xx.com
xx@xx.com
xx@xx.com
xx@xx.com
xx@xx.com
xx@xx.com
xx@xx.com
xx@xx.com";
$split_emails = split("\n",$emails);
$split_n = count($split_emails);
for ($x=0;$x&lt;$split_n;$x++) {
if(is_email($split_emails[$x]){
echo $split_emails[$x];
}
}
?&gt;
</code></pre>

<p>i'am sure that the function work right because i tested it in one email 
p.s : the $emails is from "POST Form" , but i edit it to put it here with no HTML codes ,
i guess that the error in the split , so please any help ?</p>
