方法的重载通过__call来实现,当调用不存在的方法的时候,将会转为参数调用__call方法,当调用不存在的静态方法时会使用__call Static重载。
2015-09-06
<?php
$str = "<ul>
<li>item 1</li>
<li>item 2</li>
</ul>";
$p="/\w+.?\d+/";
preg_match_all($p,$str,$matches);
print_r($matches);
echo '<br>'.'<br>';
print_r($matches[0]);
echo '<br>'.$matches[0][0];
echo '<br>'.$matches[0][1];
$str = "<ul>
<li>item 1</li>
<li>item 2</li>
</ul>";
$p="/\w+.?\d+/";
preg_match_all($p,$str,$matches);
print_r($matches);
echo '<br>'.'<br>';
print_r($matches[0]);
echo '<br>'.$matches[0][0];
echo '<br>'.$matches[0][1];
2015-09-06
$link=$mysql_connect($host,$user,$pass); //这样就过了。同学们 认真点。 很坑的
2015-09-06
if(file_exists($filename)){
echo file_get_contents($filename);
}else{
echo "this is a test file.";
}
这样写居然通过了, 我也是醉了
echo file_get_contents($filename);
}else{
echo "this is a test file.";
}
这样写居然通过了, 我也是醉了
2015-09-06
<?php
$subject = "my email is spark@imooc.com";
$p = "/\w+@.+/";
// $p = "/([\w]+@)[\w\.]+/";
preg_match($p, $subject, $matches);
echo $matches[0].'<br>'.'<br>';
print_r($matches);
$subject = "my email is spark@imooc.com";
$p = "/\w+@.+/";
// $p = "/([\w]+@)[\w\.]+/";
preg_match($p, $subject, $matches);
echo $matches[0].'<br>'.'<br>';
print_r($matches);
2015-09-05