Re: Remove white space?
| From: | Craig | Date: | Fri, 23 Apr 2004 08:33:29 +0000 |
| Subject: | Re: Remove white space? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-184361@lists.php.net to get a copy of this message | ||
trim($YOUR_VARIABLE) = Remove whitespace from beginning and end of string
http://ie2.php.net/trim
strtolower($YOUR_VARIABLE) = Makes a string lowercase
http://ie2.php.net/strtolower
Hope that helps
"Robert Sossomon" <robert@gcnorris.com> wrote in message
news:022101c42879$472334e0$6601010a@root2...
> I am pulling data from a MySQL DB and I need to remove the whitespace on
> the variable and turn it to lowercase.
>
> <! Code Snippet>
>
> $get_items = "select * from PFS_items";
> $get_items_res = mysql_query($get_items) or die(mysql_error());
> while ($items = mysql_fetch_array($get_items_res))
> {
> $item_id = $items[id];
> $item_num = $items[item_num];
>
> <! End Code Snippet>
>
> Overtime I need to rewrite my DB loading script to handle this for me,
> but right now I need to band-aid it so that I can auto-generate pages
> and get them loaded into a catalog.
>
> Thanks!
>
> Robert