note 41351 added to function.preg-match
| From: | fra at nomade dot fr | Date: | Wed, 07 Apr 2004 09:50:18 +0000 |
| Subject: | note 41351 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-67753@lists.php.net to get a copy of this message | ||
Recherche d'un block de texte encapsulé dans des tag pesro
[COMMENTS]ligne
ligne 2 [/COMMENTS]
<?php
$txt="[COMMENTS]ligne 1\nligne 2 [/COMMENTS]";
preg_match_all("(\[COMMENTS\](\S.*\s.*)\[\/COMMENTS\])", $txt , $comments);
echo $comments[1][0]; // ecrit le texte
echo $comments[0][0]; // ecrit le texte avec las tags
?>
----
Manual Page -- http://www.php.net/manual/en/function.preg-match.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+41351
Delete -- http://master.php.net/manage/user-notes.php?action=delete+41351&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+41351&report=yes
Search -- http://master.php.net/manage/user-notes.php