Monday, 12 August 2013

PHP regular expression (complex)

PHP regular expression (complex)

public function getBlock( $tag )
{
preg_match ('#<!-- START '. $tag . ' -->(.+?)
<!-- END '. $tag . ' -->#si', $this->content, $tor);
$tor = str_replace ('<!-- START '. $tag . ' -->', "", $tor[0]);
$tor = str_replace ('<!-- END ' . $tag . ' -->', "", $tor);
return $tor;
}
Does anyone know what this function does?
Regular expressions are really my weakness.

No comments:

Post a Comment