下面是实例:

$r=”my.acA45.cc”;
preg_match(“/^\w+\.(\w+)\.+\w+$/”,$r,$hostdo);
print_r($hostdo);

输出的结果是数组 “Array ( [0] => my.acA45.cc [1] => acA45 )”

“echo $hostdo[1]“-》acA45  这个就是获取中间的值了。

Sorry, the comment form is closed at this time.

   
© 2012 Ai-WEB的博客 Suffusion theme by Sayontan Sinha