[Phpwm] Truncating HTML with PHP

Alex Mace alex at hollytree.co.uk
Mon Jun 8 14:12:00 UTC 2009


I think HTML Purifier might do the job - just cut the HTML off at 400  
characters and then pass it into HTML Purifier and I believe it should  
give you standards compliant output.

htmlpurifier.org

On 8 Jun 2009, at 15:01, Mike Tipping wrote:

> I need to be able to take the fists 400 characters of some html  
> formatted
> text and incorporate it in a second HTML page so it doesn't beak the  
> page,
> ie not have unclosed <p> or <span> tags etc.
>
> Does anyone know of an easy way of doing this in PHP or am I going  
> to have
> to start counting tags myself?
>
> Cheers
>
>
> Mike
>
>
>
> _______________________________________________
> Phpwm mailing list
> Phpwm at mailman.lug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/phpwm




More information about the Phpwm mailing list