获取字符串第一个原点之前的内容吗,下面的例子:

代码片段
2 行
$str='www.lizhenqiu.com';
list($dom)=explode('.',$str);
PHP
6 行
<?php
$my_array = array("Dog","Cat","Horse");

list($a, $b, $c) = $my_array;
echo "I have several animals, a $a, a $b and a $c.";
?>
GDScript3
6 行
<?php
$my_array = array("Dog","Cat","Horse");

list($a, , $c) = $my_array;
echo "Here I only use the $a and $c variables.";
?>
PHP
5 行
<?php
$domain = "www.lizhenqiu.com";
$n = preg_match('/(.*\.)?\w+\.\w+$/', $domain, $matches);
print_r($matches);
?>