$p = "/<li>(.*?)<\/li>/i";
preg_match_all($p,$str,$matches);
print_r($matches[1]);
preg_match_all($p,$str,$matches);
print_r($matches[1]);
2017-05-22
$pattern = '/s\w+.*/';
preg_match($pattern,$subject,$matchers);
print_r($matchers[0]);
preg_match($pattern,$subject,$matchers);
print_r($matchers[0]);
2017-05-22
//定义继承于Car的Truck类
class Truck{
public function speedUp(){
$this->speed=60;
return $this->speed;
}
}
class Truck{
public function speedUp(){
$this->speed=60;
return $this->speed;
}
}
2017-05-21
$dsn = 'mysql:dbname=testdb;host=127.0.0.1';
$user = 'dbuser';
$password = 'dbpass';
$dbh = new PDO($dsn, $user, $password);
$user = 'dbuser';
$password = 'dbpass';
$dbh = new PDO($dsn, $user, $password);
2017-05-19
$page = 2;//当前页
$n = 2;//一行的显示的数量
$m = ($page - 1) * $n;//从第几行开始
$n = 2;//一行的显示的数量
$m = ($page - 1) * $n;//从第几行开始
2017-05-18