静态属性以及方法可以不用实例化,public static $speed = 10;public static function speedUp(){};如Car::speedUp(); Car::$speed;可以直接输出。
2015-04-25
$pattern = '/([\w]+\.[\w]+)/';
$replacement = '<em>$1</em>';
echo preg_replace($pattern, $replacement, $str);
$replacement = '<em>$1</em>';
echo preg_replace($pattern, $replacement, $str);
2015-04-22
$pattern='/\w+@\w+.\w+/';
preg_match($pattern,$subject,$matches);
print_r($matches[0]);
preg_match($pattern,$subject,$matches);
print_r($matches[0]);
2015-04-22