Page 1 of 1

Checking variable length

Posted: Thu Jan 01, 2009 11:18 am
by iG9
Apologies is this is obvious, but does anyone know a good function to check a variable's length? I'm trying to enforce my db's type constraints. Thanks in advance.

Re: Checking variable length

Posted: Thu Jan 01, 2009 1:15 pm
by watson516
You can use strlen to check the length of strings.

Re: Checking variable length

Posted: Mon Jan 05, 2009 8:35 pm
by iG9
Thanks man I'll give it a try.

Re: Checking variable length

Posted: Mon Jan 05, 2009 10:56 pm
by requinix
If you have the mbstring module installed (it's quite likely) I'd suggest mb_strlen instead.