开发者

Mix str_replace and regex?

开发者 https://www.devze.com 2023-02-14 02:20 出处:网络
I want to replace a string such as: <input type=\"hidden\" name=\"id\" value=\"12345\" /> but the problem I have is that the values value (12345) is different everytime so how can 开发者_开发

I want to replace a string such as:

<input type="hidden" name="id" value="12345" />

but the problem I have is that the values value (12345) is different everytime so how can 开发者_开发知识库I do what I'm trying to do? ..I'm guessing regex' but havent a clue


preg_replace('/\<input type="hidden" name="id" value="[0-9]+" \/\>/is', '', $source)
0

精彩评论

暂无评论...
验证码 换一张
取 消