<?php
$re = '/<input.+>(.*)</m';
$str = ' <input type="radio" name="562" value="1" onclick> turtle.show() <br>
<input type="radio" name="562" value="2"> turtle.showLocation() <br>
<input type="radio" name="562" value="3"> turtle.showDirection() <br>
<input type="radio" name="562" value="4"> turtle.showturtle() <br><input type="hidden" id="ans562" value="4">';
preg_match_all($re, $str, $matches);
// Print the entire match result
var_dump($matches);
- Output for 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
- array(2) {
[0]=>
array(4) {
[0]=>
string(65) "<input type="radio" name="562" value="1" onclick> turtle.show() <"
[1]=>
string(65) "<input type="radio" name="562" value="2"> turtle.showLocation() <"
[2]=>
string(67) "<input type="radio" name="562" value="3"> turtle.showDirection() <"
[3]=>
string(67) "<input type="radio" name="562" value="4"> turtle.showturtle() <br><"
}
[1]=>
array(4) {
[0]=>
string(15) " turtle.show() "
[1]=>
string(23) " turtle.showLocation() "
[2]=>
string(25) " turtle.showDirection() "
[3]=>
string(0) ""
}
}
preferences:
131.06 ms | 409 KiB | 5 Q