![]() |
Using substr best method?
I've finally come back to doing a script I was working on awhile back, where originally I was trying to use a regular expression to find the first two paragraph elements in a block of text, and trim everything that occurred after. With all the learning I've been doing since, I've come to the realization that I can do it much faster with a combination of strpos() and substr(), and I'm just wondering if this is the best syntax here, or if there's something I'm missing that could clean it up even further?
What I'm doing is trying to find the second occurence of </p> and strip everything after. So what I did was this: PHP Code:
PHP Code:
PHP Code:
Either way, strpos() still seems to be the fastest method. Any ideas on better ways? :-/ -m |
| All times are GMT. The time now is 06:09 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0