You are here: Re: Probs with strlen ?? « PHP Programming Language « IT news, forums, messages
Re: Probs with strlen ??

Posted by max on 08/28/05 15:28

On Sun, 28 Aug 2005 13:41:34 +0200, Hanjo Grüßner <hanjo@gruessner.de>
wrote:

>Hello,
>
>I'm doing like this:
>
>if (strlen($Name_vor) > 0)
> echo '</table></fieldset>';
>
>
>But the program never goes into the 'echo' branch.
>
>I tried to get strlen($Name_vor) before the condition and it is definivly
>> 0
>
>
> From te manual strlen returns an INT.
>
>What is wrong ??
>
>TIA
>
>Hanjo
If you're just checking that $Name_vor has a length (and, thus, that it
exists) can you not go -

if ($Name_vor) do_such_and_such;

Have you had a look at www.php.net/strlen ? One of the contributions there
helped me solve a problem -

QUOTE
Beware: strlen() counts new line characters at the end of a string, too!

$a = "123\n";
echo "<p>".strlen($a)."</p>";

The above code will output 4.
UNQUOTE

 

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

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