something wrong with replace string? [closed]

穿精又带淫゛_ 提交于 2019-12-14 03:34:04

问题


Can anyone help me with this:

<?php
$remove = $_GET['hwid'];
str_replace($_GET['hwid']."<br />","",$str);
?>

It doesnt even delete the text...

I Know i dont have it set to the html file i have thats because i don't know how to with this string...


回答1:


Let's say you have this as you retrieved text (whether from html or any other form):

$str="THE HTML FILE:

Test

Test1

Test2

Test3";

this function will remove "Test2" from the string:

$newstr=str_replace("Test2","",$str);

for more information of the function take a look at here

Just one more thing, if you have <br> after each line in your example, you need to do the same for those too.



来源:https://stackoverflow.com/questions/16473300/something-wrong-with-replace-string

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!