我正在尋找preg_replace方法從字符串中剝離所有$_GET['whatever']
和所有$_POST['values']
。
例如,如果字符串是:
$str = "this is some text with $_POST['foo'] within it - and some $_GET['bar'] as well";
我想擁有它返回:
$str = "this is some text with within it - and some as well";
感謝。
很酷,到目前爲止你有什麼? – danronmoon 2014-09-04 01:17:03
是不是可以刪除$ str中的$ _POST和$ _GET變量? – kimbarcelona 2014-09-04 01:20:10
如果是關於無效語法,如此處所示,而不是實際的字符串內容,那麼請使用您的編輯器搜索和替換函數。 – mario 2014-09-04 01:21:54