You are here: Re: How to count lines from a form? « PHP Programming Language « IT news, forums, messages
Re: How to count lines from a form?

Posted by andy.z on 03/12/07 12:25

In article <1173696650.014897.36950@s48g2000cws.googlegroups.com>,
jon.pulice@gmail.com says...
> On Mar 12, 5:58 am, and...@blueyonder.com wrote:
> > I'm having trouble working this out ...
> >
> > Is there a simple way to count how many lines are returned in
> > $_POST['myTextArea']
> >
> > When I look at the $_POST all I see is one line yet there are three.
> > I assume something is being interpreted differently depending on how I
> > view it.
> >
> > Is there a simple funtion for this or can someone tell me how to work it
> > out please?
> >
> > Thanks
> >
> > andy
>
>
> Hey,
>
> This should do the trick,
>
> $lineCount = count( explode( "\n" , $_POST['test'] ) );
>
> where 'test' is the nameof the textarea field
>
>

clever!
Thanks - that makes sense now I've seen it ;-)
I'll give it a go.

cheers

andy

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация