note 63694 deleted from function.preg-match-all by colder

From: Date: Mon, 16 Apr 2007 17:03:06 +0000
Subject: note 63694 deleted from function.preg-match-all by colder
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-125471@lists.php.net to get a copy of this message
Note Submitter: slavomir dot hustaty at gmail dot com ---- //<h1>some text</h1><b>bold</b><h1>some further text</h1> //if needed what's between tags :-) class find_regex { var $search_tag; var $result; //preg_match_all("/(<h1[^>]*>)([^<]*)(<\/h1>)/", $html, $matches); function find_regex($tag = "h1") { $this->search_tag = $tag; } function parse($text_to_parse = "") { $regex = "/(<" . $this->search_tag . "[^>]*>)([^<]*)(<\/" . $this->search_tag . ">)/"; preg_match_all( $regex , $row->buffer_sk , $matches ); $this->result = $matches; return $matches[2]; } }

« previous php.notes (#125471) next »