class sg{
var $name = '水果';
function getname(){
return $this ->name;
}
}
$sg = new sg();
$sg ->name = '菠萝';
echo $sg ->getname();
var $name = '水果';
function getname(){
return $this ->name;
}
}
$sg = new sg();
$sg ->name = '菠萝';
echo $sg ->getname();
2017-11-03
<?php
$subject = "my email is spark@imooc.com";
//在这里补充代码,实现正则匹配,并输出邮箱地址
$pattern = '/[^\s]+@\w+\.\w+/';
//[^\s]+表示一次或多次匹配非空白符。
preg_match($pattern, $subject, $matches);
echo $matches[0];
$subject = "my email is spark@imooc.com";
//在这里补充代码,实现正则匹配,并输出邮箱地址
$pattern = '/[^\s]+@\w+\.\w+/';
//[^\s]+表示一次或多次匹配非空白符。
preg_match($pattern, $subject, $matches);
echo $matches[0];
2017-11-02