registerXPathNamespace() 函数为下一次 XPath 查询创建命名空间语境。 getNamespace() 函数获取在 XML 文档中使用的命名空间。 getName() 函数从 SimpleXMLElement 对象获取 XML 元素的名称。 getDocNamespaces() 函数从 SimpleXMLElement 对象返回在 XML 文档中声明的命名空间。 children() 函数获取指定节点的子节点。
$month=@$_GET['month']; //获得地址栏的月份 if(empty($year)) $year=date("Y"); //初始化为本年度的年份 if(empty($month)) $month=date("n"); //初始化为本月的月份 $day=date("j"); //获取当天的天数 $wd_ar=array("日","一","二","三","四","五","六"); //星期数组 $...
zip_entry_name() 函数返回 zip 档案项目的名称。 zip_entry_filesize() 函数返回 zip 档案项目的原始大小(在压缩之前)。 zip_entry_compressionmethod() 函数返回 zip 档案项目的压缩方法。 zip_entry_compressedsize() 函数返回 zip 档案项目的压缩文件尺寸。 zip_entry_close() 函数关闭由 zip_entry_open()...
registerXPathNamespace() 函数为下一次 XPath 查询创建命名空间语境。 getNamespace() 函数获取在 xml 文档中使用的命名空间。 getName() 函数从 SimplexmlElement 对象获取 xml 元素的名称。 getDocNamespaces() 函数从 SimplexmlElement 对象返回在 xml 文档中声明的命名空间。 children() 函数获取指定节点的子节点。
<?phpif($argc!=2){echo"Usage: php hello.php [name].\n";exit(1);}$name=$argv[1];echo"Hello,$name\n"; PHP 会在脚本运行时根据参数设置两个特殊的变量,$argc是一个整数,表示参数个数,$argv是一个数组变量,包含每个参数的值, 它的第一个元素一直是 PHP 脚本的名称,如本例中为hello.php。
134.readfile(): 输出一个文件 调用: int readfile ( string $filename [, bool $use_include_path [, resource $context ]] )输出: 读入一个文件并写入到输出缓冲。返回从文件中读入的字节数。如果出错返回 FALSE135.file_get_contents(): 将整个文件读入一个字符串 ...
<?php$date = new DateTime;echo $date->format('Y-m-d H:i:s');echo $date->format('Y-m-d');echo $date->getTimestamp();// 时间戳$timezone = $data->getTimezone();echo $timezone->getName();// Asia/Shanghai 自定义时间 ...
%A - full weekday name %b - abbreviated month name %B - full month name %c - preferred date and time representation %C - century number (the year divided by 100, range 00 to 99) %d - day of the month (01 to 31) %D - same as %m/%d/%y %e - day of the month (1 to 31...
* @param year*/functiongetLunarYearName($year){$sky=array('庚','辛','壬','癸','甲','乙','丙','丁','戊','己');$earth=array('申','酉','戌','亥','子','丑','寅','卯','辰','巳','午','未');$year=$year.'';return$sky[$year{3}].$earth[$year%12]; ...
$filename = $_GET['file']; //Get the fileid from the URL // Query the file ID $query = sprintf("SELECT * FROM tableName WHERE id = '%s'",mysql_real_escape_string($filename)); $sql = mysql_query($query); if(mysql_num_rows($sql) > 0){ ...