Home » Php » Advance Php Interview Question » Remove special characters from an array that isn’t a letter, number or space

Remove special characters from an array that isn’t a letter, number or space

Remove special characters from an array that isn't a letter, number or space

If you want to remove only special character from an array element that isn't a letter, number or space. You can use preg_replace function to remove the special character from an array element that isn't a letter, number or space from any place.  
 

you can also remove the special character from an associative array element that isn't a letter, number or space from any place, and that is return same indexing with removed value.

Remove arrays element that contain only special characters

If you want to remove only those array element which have only special(all special) characters, you can used below function

, , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">