FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » string length
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: string length [message #185321 is a reply to message #185320] Tue, 18 March 2014 15:11 Go to previous messageGo to previous message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma:
Senior Member
In article <umgkqacqlbwl(dot)1erkg4bj91fbo$(dot)dlg(at)40tude(dot)net>, richard
<noreply(at)example(dot)com> wrote:

> What can I use to count the number of characters in a string?
> strlen() does not seem to work properly.

IME, it does.

> count_chars() does several different things but does not count the total.
> In BASIC I would use value=len(a$).
> I've had a look at the string functions and don't see a one that does this.
>
> what I'm looking to do is, read a directory and load an array based upon
> certain conditions of the file name.
>
> Using strlen and trying to match the file length to a fixed value does not
> work for me.

Suggest you give some examples which fail. You sure there are no
unprintable characters in the filename?

I've never had a problem with strlen.

--
"I am enclosing two tickets to the first night of my new play; bring a
friend.... if you have one." - GB Shaw to Churchill "Cannot possibly
attend first night, will attend second... if there is one." - Winston
Churchill, in response.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Nested PHP
Next Topic: weird global issue
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 19:25:45 GMT 2024

Total time taken to generate the page: 0.04499 seconds