2015-03-06, 06:33 PM
This code only strips the characters provided in the code but I would like to remove all of them leave only numbers and letters!
Please help me to combine these codes:
This is what I think will remove all of them but not sure how to combine it:
This is what I have come up with is it correct?
Please help me to combine these codes:
$stags = strip_tags($thread['subject']);
$tagsht = htmlspecialchars_uni($stags);
$codes = "{ } [ ] ( ) \" ' < > : ; . , - _ + * ! ? = $ % & ¡ ¿ /"; //here should remove all special characters
$searchcodes = explode(" ",$codes);
$rtags = str_replace($searchcodes, " ", $tagsht);
$rtagsp_br = preg_replace("/\r\n|\r/", " ", $rtags);
$tags = trim($rtagsp_br);
$explode = explode(" ", $tags);
$tags = array();
$countags = 0;
foreach($explode as $strlen)
This is what I think will remove all of them but not sure how to combine it:
$output = preg_replace("/[^A-Za-z0-9]/","",$input);
This is what I have come up with is it correct?
$stags = "This code only strips the characters provided in the code but I would like to remove all of them leave only numbers and letters!
";
$tagsht = htmlspecialchars_uni($stags);
$rtags = preg_replace("/[^A-Za-z0-9]/", " ",$tagsht);
$rtagsp_br = preg_replace("/\r\n|\r/", " ", $rtags);
$tags = trim($rtagsp_br);
$explode = explode(" ", $tags);
$tags = array();
$countags = 0;
foreach($explode as $strlen)