Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
$response = '<input type="hidden" autocomplete="off" name="timezone" value="180" id="u_0_9">';
preg_match_all('/name="(.*?)" value="(.*?)"/is', $response, $names);
print_r($names);
// Output: Array ( [0] => Array ( [0] => name="timezone" value="180" ) [1] => Array ( [0] => timezone ) [2] => Array ( [0] => 180 ) )
$response = '<input type="hidden" name="jazoest" value="2703" autocomplete="off">';
preg_match_all('/name="(.*?)" value="(.*?)"/is', $response, $names);
print_r($names);
// Output: Array ( [0] => Array ( [0] => name="jazoest" value="2703" ) [1] => Array ( [0] => jazoest ) [2] => Array ( [0] => 2703 ) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.