str replace - How to remove brackets (chevrons) in php -
out there, have question:
i want remove chevrons (brackets) string in php
:
example: string= ">autor</"
want remove <
, </
, how this?
i tried this:
$result = ">autor</"; $result = str_replace(arr0ay(">","</"),"",$result); echo $result;
but won't remove characters want removed, have idea?
thanks in advance
edit: //list contains attributes, autor, titel
foreach($list $show){ $show = trim($show); $text=htmlspecialchars($xml->hits->hit[$j]->info); echo $show." = "; preg_match ("/$show.*$show/", $text, $result); $result = implode($result); $result = str_replace(array("$show",">","</"),"",$result); $result = str_replace(array(">","</"),"",$result); echo $result; }
so found out, how it, , if else have same problem got, know how it:
you need str_replace("oldstring_to_find", "newstring_oldstring_get_replaced_with","variable");
thx help
Comments
Post a Comment