preg_match('<[ \w"=]+name="xhpc_composerid"[ \w="]+>',$exec,$result1);
echo $result1[0];
//input type="hidden" autocomplete="off" name="xhpc_composerid" value="u_0_1k"
preg_match('/value="[\w]+"/i',$result1[0],$result2);
echo $result2[0];
// value="u_0_1k"
$result3 = preg_replace('/value="/i',"ab123",$result2[0]);
echo $result3[0];
// a
$result4 = substr($result3[0],0,-1);
echo $result4;
// (vazio)
The question is $result2
printing value="u_0_1k"
, why $result3
print a
? My regex should be correct, I expected something like: u_0_1k"
, then in $result4
would print what I printed in $result3
only without double quotation marks, what can I be wrong?