易截截图软件、单文件、免安装、纯绿色、仅160KB

php 中的判断 总结

<?php
/* 判断常量是否存在*/
if (defined('MYCONSTANT')) {
echo MYCONSTANT;
}
//判断变量是否存在
if (isset($myvar)) {
echo "存在变量$myvar.";
}
//判断函数是否存在
if (function_exists('imap_open')) {
echo "存在函数imag_open\n";
} else {
echo "函数imag_open不存在\n";
}
//判断类是否存在
if (class_exists('MyClass')) {
$myclass = new MyClass();
}
//判断文件是否存在
$filename = '/path/to/foo.txt';
if (file_exists($filename)) {
echo "The file $filename exists";
} else {
echo "The file $filename does not exist";
}
//判断数组中是否存在某成员
$os = array("Mac", "NT", "Irix", "Linux");
if (in_array("Irix", $os)) {
echo "Got Irix";
}
//判断变量类型
is_array()
is_bool()
is_float()
is_integer()
is_null()
is_numeric()
is_object()
is_resource()
is_scalar()
is_string()
?> 


相关文档:

ubuntu10.04配置apache+php+mysql

1.安装apache2.0
  sudo apt-get install apache2
  安装后在浏览器中打开:
 
 http://localhost/或者http://127.0.0.1
  如果出现It works!,那证明安装成功。
 
 2.安装PHP
  sudo apt-get install php
5 //安装PHP
5
 
 sudo apt-get install libapache2-mod-php5 //配置APACHE+PHP
  sud ......

PHP的基础知识

看了些PHP的基础知识,自己在这里总结下:
1,在HTML嵌入PHP脚本有三种办法:
<script language="php">
//嵌入方式一
echo("test");
</script>
<?
//嵌入方式二
echo "<br>test2";
?>
<?php
//嵌入方式三
echo "<br>test3";
?>
  还有一种嵌入方式,即使用 ......

Apache 2 and PHP 5 (mod_php) on Linux


Apache 2 and PHP Installation
The following notes are how I got Apache 2 and PHP 5 (or PHP 4) working together on Linux. These instructions also apply, mostly, for any UNIX-like system, especially other Linux distributions. If you have a recent Linux distribution (say since 2002), you already hav ......

Aptana studio 2.0 +aptana php plugin 1.1

I’ve just updated Aptana Studio from 1.5 to 2.0 only to find out that the spectacular Aptana PHP plugin is not longer supported and its installation has been removed from the Install Additional Features view. However, with some tricks we can still install the old Aptana 1.5.1 in order to use i ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号