3v4l.org

run code in 300+ PHP versions simultaneously
<?php $b= 1234; $your_variable = '<input name="LFMIdsite" value="8635" type="hidden">'; $result = preg_replace('/name="LFMIdsite" value="(.*?)"/', 'name="LFMIdsite" value="'$b'"/', $your_variable); echo $result; //$lidsite = $matches[1]; //echo $lidsite; //$your_variable = str_replace('/name="LFMIdsite" value="'.$lidsite.'"', '/name="LFMIdsite" value="'.$b.'"', $your_variable); //echo $your_variable;
Output for 5.4.0 - 5.4.25
Parse error: syntax error, unexpected '$b' (T_VARIABLE) in /in/a26pP on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE in /in/a26pP on line 6
Process exited with code 255.

preferences:
204.24 ms | 1395 KiB | 62 Q