Return to Snippet

Revision: 18876
at October 11, 2009 10:13 by jnbn


Initial Code
function get_tag( $tag, $xml ) {
  $tag = preg_quote($tag);
  preg_match_all('{<'.$tag.'[^>]*>(.*?)</'.$tag.'>.'}',
                   $xml,
                   $matches,
                   PREG_PATTERN_ORDER);

  return $matches[1];
}

Initial URL


Initial Description


Initial Title
Matching a XML/HTML tag

Initial Tags


Initial Language
PHP