hehexu

博客园 首页 新随笔 联系 订阅 管理

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
)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

posted on 2018-01-15 22:32  hehexu  阅读(159)  评论(0)    收藏  举报