PHP基础篇(4)

对象的使用

<?php
class person{
var $name;
function say(){
echo “DDING FOO”;
}
}
$p=new person;
$p->name=”TOM”;
$p->say();
?>

获取资源

/fopen()函数以写的方式打开本目录下的文件/
$file_handld=fopen(“info.txt”,”w”);

/opendir()函数打开Windows系统下的c://windows//font 目录/
$dir_handle=opendir(“c://windows//fonts”);

/使用mysql_connect()函数连接本机的MySQL管理系统/
$link=mysql_connect(“localhost”,”root”,”123456”);

/使用imagecreate()创建一个10050的画板*/
$im_hand=imagecreat(100,50);

/使用xml_parser_create创建xml解析器/
$xml_parser_create(可选。规定输出代码);

Fork me on GitHub