ITeye博客

php

共 7 篇文章

php无法调用shell

1.修改php.ini文件,将disable_functions中的shell等去掉 2.重启php,service php-fpm restart

2015-09-14 11:27 · php

php类

<?php class A { function f1() { if(isset($this)){ echo "is defined,".get_class($this)."\n"; }else{ echo "is not defined\n"; } } } class B { function f2() { A::f1(); } } $a = new A; $b = new B; $a->f1(); A::f1(); $b->f2(); B::f2(); ?> is defined,A is not defined is defined,B is not defined <?php cla…

2014-12-30 10:09 · php

执行shell

[code="php"] $output"; $output2 = shell_exec("ls -al"); echo $output2; ?> [/code] 总用量 44 drwxr-xr-x. 3 root root 4096 12月 17 15:00 . drwxr-xr-x. 7 www www 4096 12月 17 10:45 .. -rw-r--r--. 1 root root 505 12月 12 14:19 .buildpath -rw-r--r--. 1 root root 764 12月 12 14:35 index.php -rw-r--r--. 1 root r…

2014-12-22 17:11 · php

php常量

Hello world.Constant

2014-12-19 14:13 · php

php类

<?php function test() { echo "abc\n"; } class A { function test() { echo "A:abc\n"; } function test1($str) { echo "A::test1".str; } } A::test(); call_user_func("test"); call_user_func("A::test"); $a = new A(); call_user_func(array($a,"test")); $a->test1("str"); ?> A:abc abc A:abc A:abc A::test1str

2014-12-18 16:43 · php

php数组

<?php $arr = array(1,"2","3",4,5); print_r($arr); foreach($arr as $a => $value) { echo $arr[$a]." "; } echo "\n"; $arr[] = "6"; $arr[] = 7; print_r($arr); printf("\r\n%d %s\r\n",$arr[0],$arr[1]); unset($arr[0]); print_r($arr); Array ( => 1 => 2 => 3 => 4 => 5 ) 1 2 3 4 5 Array ( => 1 => 2 => 3 => 4…

2014-12-17 14:53 · php

lnmp自动安装脚本

http://lnmp.org

2014-12-12 11:20 · php