Re: Counting HTML Lines

From: Date: Fri, 15 Apr 2005 09:31:58 +0000
Subject: Re: Counting HTML Lines
References: 1 2 3 4  Groups: php.db 
Request: Send a blank email to php-db+get-39200@lists.php.net to get a copy of this message
Hi! thank you so much for your help!! do you mean to do ob_get_contents() before i do a ob_end_flush()? but even if i'm successful in counting the number of "\n"s, HTML tags like <html>,<head>,<script> will also give me a count for "\n"s but in actual fact, they do not contribute to the screen output. how can i get round this problem? =( thanks thanks... ----- Original Message ----- From: "Jyrki Laurila" <jyrki.laurila@gmail.com> To: <php-db@lists.php.net> Sent: Friday, April 15, 2005 5:25 PM Subject: Re: [PHP-DB] Counting HTML Lines > Firstly, you are printing the output directly, so in case you don't > mark the lines you are printing out after each section, there is no > way to count the lines. > > Secondly, "HTML" doesn't "push" the text automatically to anywhere, it > is your text-editor. > HTML is presented as it's written on the file. So if your text-editor > chops the text to multiple lines, then it's no-can-do. Though, usually > text-editors don't add "\n"'s in text, even if they show a long line > chopped to multiple lines in edit-mode. > > A solution would be for you to process the HTML to a variable first > and then print it. > This way you can also count the lines by counting the number of "\n"'s. > > -- > Regards, > Jyrki Laurila > > > On 4/15/05, Ng Hwee Hwee <hhwee@towa.com.sg> wrote: > > hi! > > > > thanx for your reply. i cannot count the number of "\n" because sometimes > > the inputted text is very long without any "\n", but because it is inside a > > cell that has a linited width, HTML will automatically push it to the next > > line, right? in this case, there won't be a count for "\n". > > > > hwee > > > > ----- Original Message ----- > > From: "Petar Nedyalkov" <bu@orbitel.bg> > > To: <php-db@lists.php.net> > > Sent: Friday, April 15, 2005 5:06 PM > > Subject: Re: [PHP-DB] Counting HTML Lines > > > > Count the "\n" characters in the output.

« previous php.db (#39200) next »