Created
August 19, 2011 10:19
-
-
Save Ibmurai/1156530 to your computer and use it in GitHub Desktop.
PHP, regex and double quoted strings are fun...
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 | |
/* This handy script lets you locate escaped backslashes in the prettiest way. */ | |
$input = $_POST['value']; | |
$matches = array(); | |
if (preg_match("/\\\\/", $input, $matches)) { | |
var_dump($matches); | |
} else { | |
echo "No matching \"\\\\\"'s found."; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment