<?php
$re = '/([$][a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+)/m';
$str = '"SELECT * FROM table WHERE admin=\'".$admin."\' AND id=".$idclient." AND something=".$something;';
$subst = 'functionname($1)';
$result = preg_replace($re, $subst, $str);
echo $result;
- Output for 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.27, 8.3.0 - 8.3.16, 8.4.1 - 8.4.3
- "SELECT * FROM table WHERE admin='".functionname($admin)."' AND id=".functionname($idclient)." AND something=".functionname($something);
preferences:
141.04 ms | 408 KiB | 5 Q