settype — 设置变量的类型
<?php
$foo = "5bar"; // string
$bar = true; // boolean
settype($foo, "integer"); // $foo 现在是 5 (integer)
settype($bar, "string"); // $bar 现在是 "1" (string)
?>
gettype — 获取变量的类型
parse_url — 解析 URL,返回其组成部分
<?php
$url = 'http://username:password@hostname/path?arg=value#anchor';
print_r(parse_url($url));
?>
Array
(
[scheme] => http
[host] => hostname
[user] => username
[pass] => password
[path] => /path
[query] => arg=value
[fragment] => anchor
)