3232d sddshiouds+´ñp+´ñ+´dñ in php

To remove all non-alphanumeric characters from a string in PHP, you can use preg_replace function with regular expression. Here's an example code:

main.php
$string = "3232d sddshiouds+´ñp+´ñ+´dñ";
$string = preg_replace('/[^a-zA-Z0-9]/', '', $string);
echo $string; // outputs 3232dsddshioudspd
139 chars
4 lines

In the code above, preg_replace function searches for all non-alphanumeric characters ([^a-zA-Z0-9]) in the $string variable and replaces them with an empty string ''. The resulting string is stored back in $string variable and then printed to the screen.

gistlibby LogSnag