You are here: Re: Nunber check Function failing « PHP Programming Language « IT news, forums, messages
Re: Nunber check Function failing

Posted by klenwell on 09/28/07 22:01

On Sep 28, 1:51 pm, GarryJones <mor...@algonet.se> wrote:
> > What do you want to do with the invalid values?
>
> You answer made great sense and I thank both of you for the time you
> have spent on my problem.
>
> Yes, I set up the database last year totally incorrectly, something I
> am hoping to fix now I am a little more experienced.
>
> For instance, a field in table_2007 can have the value 15 303 stored
> as varchar. I want php to create a variable to the form with the
> proposed value 15303. Then when the user presses ok, this value (or a
> new one if the user so chooses) will be inserted in table_2008 (INT
> UNSIGNED). Therefore I need code (poss a function similar to the one I
> was trying to use) which removes the blank between 15 and 303 when the
> variable that proposes the value is executed.
>
> I feel I have learnt masses today, much obliged.
>
> Garry Jones
> Sweden


> Therefore I need code (poss a function similar to the one I
> was trying to use) which removes the blank between 15 and 303 when the
> variable that proposes the value is executed.

This should do for the simple case you describe:
http://www.php.net/manual/en/function.str-replace.php

If you expect more complex patterns, use:
http://www.php.net/manual/en/function.preg-replace.php

Tom

 

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

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