Page 1 of 1

PHP Preg_match

Posted: Tue Mar 15, 2011 7:36 pm
by shuhail

Code: Select all

  if( !preg_match("/^[0-9]{4}[-]{1}[0-9]{4}[-]{1}[0-9]{4}[-]{1}[0-9]{4}?$/", $abc) )
  { 
    $status = "failure"; 
  }
  elseif( substr($abc,10,1)*substr($abc,11,1)*substr($abc,12,1)*substr($abc,13,1) != substr($abc,15,4) )
  { 
    $status = "failure"; 
  }
  else
  { 
    $status = "success"; 
  } 
what does it means?
how could I find the value of $abc?

Thanks.

Re: PHP Preg_match

Posted: Wed Mar 16, 2011 11:00 am
by AbraCadaver

Code: Select all

echo $abc;

Re: PHP Preg_match

Posted: Wed Mar 16, 2011 10:23 pm
by jaceinla
looks like it's a regular expression asking for

####-####-####-####