Created
March 7, 2017 17:13
-
-
Save gr1ev0us/a44535e32522b2d3779bb5e08e5d9004 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$list= | |
' | |
8.3.2017 | |
15.3.2017 | |
21.3.2017 | |
27.3.2017 | |
' | |
; | |
$date1 = '7.3.2017'; | |
$date2 = '27.3.2017'; | |
echo preg_quote($date1) . PHP_EOL; | |
$regex = '#^'.preg_quote($date1).'$#m'; | |
var_dump(preg_match($regex, $list)); | |
echo preg_quote($date2) . PHP_EOL; | |
$regex = '#^'.preg_quote($date2).'$#m'; | |
var_dump(preg_match($regex, $list)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment