You are here: Re: [PHP] Removing special characters « PHP « IT news, forums, messages
Re: [PHP] Removing special characters

Posted by Dotan Cohen on 10/21/92 11:21

On 7/14/05, Computer Programmer <myprogram@gmail.com> wrote:
> Is there a PHP built-in function to retrieve only the alphanumeric
> characters from a given string?
>
> I know that I can check for alphanumeric characters using the
> function ctype_alphanum () but it won't retrieve the alphanum characters.
>
> I also know that I can use str_replace to replace an array of special
> characters such as the example below:
>
> $str = "I*m using <html tags> with special/chars like | how to get
> rid of it???";
> $removeChars = array ('*','?','|','>','<','/','\\');
> $str = str_replace ($removeChars, "", $str);
>
> However, could there be a specific function for just retrieving
> alphanumeric characters? or a specific function for just stripping
> special characters? Or maybe a better way to do those things from the
> example given above?
>
> Thanks in advance. :)
>

Try this:
http://us2.php.net/manual/en/function.recode-string.php

Dotan
http://x-christmas.com
Christmas

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация