NYCPHP Meetup

NYPHP.org

[nycphp-talk] PHP Regexp Classic Challenge

Chuck Reeves chuck.reeves at gmail.com
Fri Nov 19 10:06:04 EST 2010


I would recommend using DOMDocument instead of regex.

Thank You
Chuck Reeves




2010/11/19 Peter Sawczynec <ps at blu-studio.com>

> I need to be able to grab the first 10 words or so from a HTML laden text
> string that is held in a db table field where the typical field content
> might be as follows below. After the processing, being left with only the
> straight text with punctuation would be fine
>
>
>
> <p><img src="/files/Screen%20img.png" alt="Fresh food makes for a great
> snack." width="180" height="272" style="float: right;" /> </p>
>
> <p>Target bodu content begins here <em>and</em> may have any html tags
> interspersed. Plus, users can users can use parens (anywhere) too.</p>
>
> <br />------<br />
>
> <p>Another paragraph</p>
>
>
>
> I'm checking to see if over the years a best practice technique with regexp
> or php funcs has been established to readily sove this classic display
> challenge.
>
>
>
> Thanks for any <input />.
>
>
>
> Warmest regards,
>
>
>
> Peter Sawczynec
>
> Technology Dir.
>
> blūstudio
>
> 941.893.0396
>
> ps at blu-studio.com <ps at sun-code.com>
>
> www.blu-studio.com
>
>
>
> _______________________________________________
> New York PHP Users Group Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> http://www.nyphp.org/Show-Participation
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20101119/60e5ed11/attachment.html>


More information about the talk mailing list