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 #185323 is a reply to message #185321] Tue, 18 March 2014 15:39 Go to previous messageGo to previous message
Peter H. Coffin is currently offline  Peter H. Coffin
Messages: 245
Registered: September 2010
Karma:
Senior Member
On Tue, 18 Mar 2014 15:11:16 +0000, Tim Streater wrote:
> 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.

Wild-assed guess. Multibyte characters biting his bottom. If I'm right,
this will be even more entertaining than third normal form...

--
85. I will not use any plan in which the final step is horribly
complicated, e.g. "Align the 12 Stones of Power on the sacred altar
then activate the medallion at the moment of total eclipse."
Instead it will be more along the lines of "Push the button."
[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: Wed Nov 27 20:37:41 GMT 2024

Total time taken to generate the page: 0.04132 seconds