zoukankan      html  css  js  c++  java
  • PHP手册学习 简单

    <?php
    $_bool = true;
    echo gettype($_bool);
    $_string = (string)$_bool;
    
    
    echo "<BR><BR>";
    echo gettype($_string);
    
    
    echo "<BR><BR>";
    echo (int) ( (0.1+0.7) * 10 ); 
    
    //定界符
    echo "<BR><BR>";
    $str = <<<END
    大家好, 定界符出来了,
    谢谢!妈的你好意思,现在才看这块!
    END;
    class foo
    {
        var $foo;
        var $bar;
    
        function foo()
        {
            $this->foo = 'Foo';
            $this->bar = array('Bar1', 'Bar2', 'Bar3');
        }
    }
    
    $foo = new foo();
    $name = 'MyName';
    echo <<<END
    fooclass Name ".$name.", is bar:".{$foo->bar[1]};
    END;
    
    echo "<BR><BR>";
    $a="Hello A";
    $b="a";
    echo "This is a {${$b}}"; //理解正确,操蛋现在才看这些
    
    echo "<BR><BR>";
    echo $a{0};
    
    echo "<BR><BR>";
    $_foo = array(1=>"xxdxxd", 2=>"xxdxxd2");
    settype($_foo, "object");
    var_dump($_foo);
    //object(stdClass)#1 (2) { [1]=> string(6) "xxdxxd" [2]=> string(7) "xxdxxd2" } 
    
    
    
    echo "<BR><BR>";
    echo  get_class($foo)."<BR>";
    echo get_parent_class($foo)."<BR>";
    $subclass = is_subclass_of($foo, "base");
    var_dump($subclass);
    //echo $foo->1;
    //$stdClass->1;
    
    
    echo "<BR><BR>";
    //get_resource_type
    $c = mysql_connect("localhost", "root","");
    echo get_resource_type($c)."<BR>";
    $fp = fopen("foo", "w");
    echo get_resource_type($fp)."<BR>";
    //$doc = new_xmldoc("1.0");
    
    
    
    ?>
    

      

  • 相关阅读:
    Zepto跨域请求
    C语言中浮点数的比较
    IOS开源项目Telegram初试
    Java NIO初试
    ios8.0之后注册通知中心
    spring AOP的配置
    IOS学习日记-2014年10月25日
    struct框架中实体类中属性的类型错误问题
    Oracle存储过程使用DML语句问题
    跳出类似framset 嵌入式框架
  • 原文地址:https://www.cnblogs.com/xiangxiaodong/p/2812890.html
Copyright © 2011-2022 走看看