0
基本上,我需要替換php文件中的文本,以便稍微更改mysqli查詢。
我使用這個功能:
file_put_contents($file,preg_replace('/^($uid=)[\d]/', '$uid=' . $uid, file_get_contents($file)));
在由$文件所表示的PHP文件替換
$uid=*any digit*
。
它完美,當我匹配的基本模式,但
'/^($uid=)[\d]/'
不會出於某種原因。