function getPrefixValue($sContents, $sPrefix = \'value\')
    {
        unset($xValue);
        $sPattern = \'/[\\s]+\'.$sPrefix.\'[\\s]*=[\\s]*(?:\\\"([^\\\"]*)\\\"|\\\'([^\\\']*)\\\'|([^\\\'\\\">\\s]+))/i\';
        $bMatch = preg_match($sPattern, $sContents, $aResult);
        if ( $bMatch ) {
            $iValue = count($aResult) - 1;
            $xValue = $aResult[$iValue];
        } else {
            $xValue = null;
        }
        return $xValue;
    };



사용법은 예를들어서
$url = \'<a href=\"http://www.google.com\">잰장</a>\';
echo getPrefixValue($url, \'href\');

이러면 href 값만 뽑아온다

이거 제쯔가 만든거