1
Good afternoon, stackoverflow crew. Is there a date in an array? I’ve been trying, using it like this:
for($i = 0; $i < count($array); $i++){
if(preg_match( "\d{1,2}/\d{1,2}/\d{4}$" , $array[$i] )){
echo 'true';
}else{
echo 'false';
}
}
Only you’ve been making mistakes:
Delimiter must not be alphanumeric or backslash in C: wamp www ecoprintQ ecoLicenseLayout json dados-partners-r epots.php on line 14
Someone knows how to do it?
Who mistakes? Error of
parse? Returns something liketrueshouldn’t you? Please be clearer.– Guilherme Nascimento
Give an example of some value that fails and another that must pass.
– rray
Must fail, any string "Hello world", "Approved registration", pass: "22/02/2017" Any date Me returns this ;Delimiter must not be alphanumeric or backslash in C: wamp www ecoprintQ ecoLicenseLayout json dados-partners-repots.php on line <i>14
– gabrielfalieri
Failed to put the delimiters in regex, leave so:
preg_match( "#\d{1,2}/\d{1,2}/\d{4}$#"– rray
Basically it’s a syntax error in Regex, I updated the tags.
– Bacco