Jump to content

Html - newbie question - thanks


notnak

Recommended Posts

Hello, I am trying to split the $content into lines, but avoid breaking the html tags.

(Inside content is an html page)

 

while (strlen($content)>0)
{
	$thous = substr($content,0,1000);//get current digit
		for ($z=1000; $z > 0 ; $z--)
			{
   				$onec = substr($thous,$z,1);
				if ( $onec = '>' )
					{
   						$current++;
   						$line[$current]=substr($content,0,$z);//get current digit
						$content=substr($content,$z,strlen($content));//reduce number string to remove last stored digit
					}
			}
   }

 

What's wrong? Thanks a lot in advance for any help.

Link to comment
https://forums.phpfreaks.com/topic/45085-html-newbie-question-thanks/
Share on other sites

Thanks for your kind replies.

 

I just want to break an ebook (simple html) into chucks of 1000 chars in order to load them into the Virtual Pagination class.

http://www.dynamicdrive.com/dynamicindex17/virtualpagination.htm

 

So, I have to maintain the html, but can't break the html when I am inside an html tag.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.