Re: [PHP] strlen ?

2013-07-11 Thread Caio Tavares
Try with mb_strlen see http://www.php.net/manual/en/function.mb-strlen.php 2013/7/5 Jim Giner jim.gi...@albanyhandball.com Trying to manage line breaks in some output I'm generating and using strlen to measure the lengths of the strings I'm printing. Discovered something strange (to me!)

Re: [PHP] strlen ?

2013-07-06 Thread Lester Caine
Jim Giner wrote: And the answer is - yes, there is a LF char at the end of my data in my whole table. Now the question is - how the heck did I put that in there? Certainly not intentionally. The data is captured from a d/e screen I wrote and it simply grabs the post value and inserts a new

Re: [PHP] strlen ?

2013-07-06 Thread Jim Giner
On 7/6/2013 2:59 AM, Lester Caine wrote: Jim Giner wrote: And the answer is - yes, there is a LF char at the end of my data in my whole table. Now the question is - how the heck did I put that in there? Certainly not intentionally. The data is captured from a d/e screen I wrote and it simply

Re: [PHP] strlen ?

2013-07-06 Thread Lester Caine
Jim Giner wrote: It's probably worth checking the sting length back through your code just to confirm what added it? The best I can figure is that I did a preload of many of the names from a csv file. Apparently when I do that it stores the LF at the end of the csv line. Have to remember that

[PHP] strlen ?

2013-07-05 Thread Jim Giner
Trying to manage line breaks in some output I'm generating and using strlen to measure the lengths of the strings I'm printing. Discovered something strange (to me!) in that strlen is returning +1 more than it should. The strings are from a query of my database - simple name fields. But

Re: [PHP] strlen ?

2013-07-05 Thread John Meyer
Jim Giner wrote: Trying to manage line breaks in some output I'm generating and using strlen to measure the lengths of the strings I'm printing. Discovered something strange (to me!) in that strlen is returning +1 more than it should. The strings are from a query of my database - simple name

Re: [PHP] strlen ?

2013-07-05 Thread shiplu
On Fri, Jul 5, 2013 at 11:10 PM, Jim Giner jim.gi...@albanyhandball.comwrote: Mike Hall comes back as 10, not 9 F.B. comes back as 5, not 4. Doesn't work for me. php var_dump(Mike Hall, strlen(Mike Hall)); string(9) Mike Hall int(9) Try trimming it first and then apply strlen. --

Re: [PHP] strlen ?

2013-07-05 Thread Jim Giner
On 7/5/2013 1:32 PM, shiplu wrote: On Fri, Jul 5, 2013 at 11:10 PM, Jim Giner jim.gi...@albanyhandball.comwrote: Mike Hall comes back as 10, not 9 F.B. comes back as 5, not 4. Doesn't work for me. php var_dump(Mike Hall, strlen(Mike Hall)); string(9) Mike Hall int(9) Try trimming it

Re: [PHP] strlen ?

2013-07-05 Thread Matijn Woudt
On Fri, Jul 5, 2013 at 8:33 PM, Jim Giner jim.gi...@albanyhandball.comwrote: On 7/5/2013 1:32 PM, shiplu wrote: On Fri, Jul 5, 2013 at 11:10 PM, Jim Giner jim.gi...@albanyhandball.com **wrote: Mike Hall comes back as 10, not 9 F.B. comes back as 5, not 4. Doesn't work for me. php

Re: [PHP] strlen ?

2013-07-05 Thread Matijn Woudt
On Fri, Jul 5, 2013 at 8:39 PM, Jim Giner jim.gi...@albanyhandball.comwrote: I checked them in the db manually. Clicked on the name, selected it, no extra space highlighted. Cursored through the length of the value - no extra movements. That does still not guarantee there are no extra

Re: [PHP] strlen ?

2013-07-05 Thread Jim Giner
On 7/5/2013 2:42 PM, Matijn Woudt wrote: On Fri, Jul 5, 2013 at 8:39 PM, Jim Giner jim.gi...@albanyhandball.comwrote: I checked them in the db manually. Clicked on the name, selected it, no extra space highlighted. Cursored through the length of the value - no extra movements. That does

Re: [PHP] strlen ?

2013-07-05 Thread Stephen
On 13-07-05 02:50 PM, Jim Giner wrote: Now the question is - how the heck did I put that in there? Certainly not intentionally. The data is captured from a d/e screen I wrote and it simply grabs the post value and inserts a new record with that value along with some other values. And I

Re: [PHP] strlen ?

2013-07-05 Thread Jim Giner
On 7/5/2013 3:02 PM, Stephen wrote: On 13-07-05 02:50 PM, Jim Giner wrote: Now the question is - how the heck did I put that in there? Certainly not intentionally. The data is captured from a d/e screen I wrote and it simply grabs the post value and inserts a new record with that value along

Re: [PHP] strlen ?

2013-07-05 Thread John Meyer
MOTS: never take any input on faith. Jim Giner wrote: On 7/5/2013 3:02 PM, Stephen wrote: On 13-07-05 02:50 PM, Jim Giner wrote: Now the question is - how the heck did I put that in there? Certainly not intentionally. The data is captured from a d/e screen I wrote and it simply grabs the

Re: [PHP] strlen ?

2013-07-05 Thread Ashley Sheridan
Jim Giner jim.gi...@albanyhandball.com wrote: On 7/5/2013 3:02 PM, Stephen wrote: On 13-07-05 02:50 PM, Jim Giner wrote: Now the question is - how the heck did I put that in there? Certainly not intentionally. The data is captured from a d/e screen I wrote and it simply grabs the post

[PHP] strlen question

2004-07-23 Thread msa
I have successfully hidden some parts of a form based on items being blank with following code: ?php if(strlen($_POST['item01']) 0) { ? ?php } ? (with the help of this forum!!) the form is separated into 5 sections and if there are no items filled out in that section, then i need to hide

Re: [PHP] strlen question

2004-07-23 Thread Matt M.
the form is separated into 5 sections and if there are no items filled out in that section, then i need to hide the title too. I have been playing around with the syntax and am not having any success...any suggestions? here is a sample of what i am trying: ?php

Re: [PHP] strlen question

2004-07-23 Thread Jake Stonebender
?php if(strlen($_POST['item01'] . $_POST['item02'] . strlen($_POST['item03'])) { ? I'm shooting for succinctness here. I'd like to see if someone has a shorter solution. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] strlen question

2004-07-23 Thread Jake Stonebender
On Fri, 23 Jul 2004 09:34:24 -0500, Jake Stonebender [EMAIL PROTECTED] wrote: ?php if(strlen($_POST['item01'] . $_POST['item02'] .$_POST['item03'])) { ? That's what I actually meant. Sorry. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] strlen() gives a wrong count

2002-03-19 Thread Gil Disatnik
Hello there, I have a 98 characters string (including spaces), wc -c says it's 98 characters and a file containing this string is 98 bytes as well. For some reason - strlen() says it's more... it says it's a 104 characters strings, when I removed the spaces (using sed on the shell and using

Re: [PHP] strlen() gives a wrong count

2002-03-19 Thread Rasmus Lerdorf
Well, how are you putting it into the string? On Tue, 19 Mar 2002, Gil Disatnik wrote: Hello there, I have a 98 characters string (including spaces), wc -c says it's 98 characters and a file containing this string is 98 bytes as well. For some reason - strlen() says it's more... it says

RE: [PHP] strlen() gives a wrong count

2002-03-19 Thread Darren Gamble
PROTECTED]] Sent: Tuesday, March 19, 2002 1:12 PM To: [EMAIL PROTECTED] Subject: [PHP] strlen() gives a wrong count Hello there, I have a 98 characters string (including spaces), wc -c says it's 98 characters and a file containing this string is 98 bytes as well. For some reason - strlen() says

RE: [PHP] strlen() gives a wrong count

2002-03-19 Thread Gil Disatnik
- 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -Original Message- From: Gil Disatnik [mailto:[EMAIL PROTECTED]] Sent: Tuesday, March 19, 2002 1:12 PM To: [EMAIL PROTECTED] Subject: [PHP] strlen() gives a wrong count Hello there, I have a 98 characters string (including

RE: [PHP] strlen() gives a wrong count

2002-03-19 Thread Rasmus Lerdorf
, March 19, 2002 1:12 PM To: [EMAIL PROTECTED] Subject: [PHP] strlen() gives a wrong count Hello there, I have a 98 characters string (including spaces), wc -c says it's 98 characters and a file containing this string is 98 bytes as well. For some reason - strlen() says it's more... it says

[PHP] strlen

2001-07-25 Thread David OBrien
I'm having a heck of a time getting something to work like it should I have a script which reads a list of words one per line I want it to display the length of the word a tab then the word. No matter how I code it it still only shows the word alone on strlen. Any ideas? ? $handle = fopen

Re: [PHP] strlen

2001-07-25 Thread David Robley
On Thu, 26 Jul 2001 05:49, David OBrien wrote: I'm having a heck of a time getting something to work like it should I have a script which reads a list of words one per line I want it to display the length of the word a tab then the word. No matter how I code it it still only shows the word