I have two div
<div id"opcao1"></div>
<div id"opcao1a"></div>
I'm using this function to capture the id
function obterID($string) {
$res = preg_match('~id="([\w]+)"~i', $string, $IDs);
if ($res){
return $IDs[1];
} else {
return "";
}
}
But I only get the div1 option, the div1 option, does not return.
Does anyone know how to do this?