PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > Re: [PHP] Regex to catch <p>s (weird result)
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Re: [PHP] Regex to catch <p>s (weird result)

Réponse
 
LinkBack Outils de la discussion
Vieux 07/05/2008, 20h05   #1
Ryan S
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Regex to catch <p>s (weird result)

<clip>


preg_match_all('|<p[^>]*>(.*)</p>|Ui', $myText, $myArray);
</clip>

Hey!

Thanks for replying.

Your preg_match_all works like a charm, but for some reason catches only 8 out of 9 paragraphs... its really weird. I have upped the test page to http://www.ezee.se/tests/para_regex2.php.txt so you can have a look at it... didnt want to post such a lot of text to the list.

Thanks again,
R


__________________________________________________ __________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i...Dypao8Wcj9tAcJ
  Réponse avec citation
Vieux 07/05/2008, 20h30   #2
Shawn McKenzie
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Regex to catch <p>s (weird result)

Ryan S wrote:
> <clip>
>
>
> preg_match_all('|<p[^>]*>(.*)</p>|Ui', $myText, $myArray);
> </clip>
>
> Hey!
>
> Thanks for replying.
>
> Your preg_match_all works like a charm, but for some reason catches only 8 out of 9 paragraphs... its really weird. I have upped the test page to http://www.ezee.se/tests/para_regex2.php.txt so you can have a look at it... didnt want to post such a lot of text to the list.
>
> Thanks again,
> R
>
>
> __________________________________________________ __________________________________
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i...Dypao8Wcj9tAcJ


Yep, sorry... Just add the s

preg_match_all('|<p[^>]*>(.*)</p>|Uis', $myText, $myArray);
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 15h47.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10021 seconds with 10 queries