Thanks : Re: [PHP] String Length ??
| From: | gordon stewart | Date: | Mon, 22 Mar 2004 13:28:08 +0000 |
| Subject: | Thanks : Re: [PHP] String Length ?? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-181138@lists.php.net to get a copy of this message | ||
--- Filip de Waard <dewaard@netcollective.nl> wrote:
> strlen() is the correct function to use here. Use it
> like:
>
> echo strlen($_POST['input_name']);
>
> Where $_POST['input_name'] should be replaced by the
> variable you want
> to check. strlen() is always right, but it counts
> the actual charactars
> of the string (which may differ from those who are
> shown in the
> browser, please look at the HTML source instead).
Thanks - Yep - Lots of spaces in my output...
Ive added a small regex & its got rid of the lines :)
$pattern = "/\s+/i";
$replacement = " ";
$texta= preg_replace($pattern, $replacement, $texta);
G
__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html