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

某大公司的PHP面试题(转载自PHP100)

1. 如何用php的环境变量得到一个网页地址的内容?ip地址又要怎样得到?
[php]
echo $_SERVER ['PHP_SELF'];
echo $_SERVER ['SERVER_ADDR'];
[/php]
2. 求两个日期的差数,例如2007-2-5 ~ 2007-3-6 的日期差数
[php]
$begin=strtotime('2007-2-5');
$end=strtotime('2007-3-6');
echo ($end-$begin)/(24*3600);
[/php]
3. 请写一个函数,实现以下功能:
字符串“open_door” 转换成 “OpenDoor”、”make_by_id” 转换成 ”MakeById”。
[php]
function changeStyle(& $str) {
/*$str = str_replace ( "_", " ", $str );
$str = ucwords ( $str );
$str = str_replace ( " ", "", $str );
return $str;*/
$arrStr=explode('_',$str);
foreach($arrStr as $key=>$value){
  $arrStr[$key]=strtoupper(substr($value,0,1)).substr($value,1);
}
return implode('',$arrStr);
}
$s = "open_door";
echo changeStyle ( $s );
[/php]
4. 要求写一段程序,实现以下数组$arr1转换成数组$arr2:
[php]$arr1 = array (
'0' => array ('fid' => 1, 'tid' => 1, 'name' =>'Name1' ),
'1' => array ('fid' => 1, 'tid' => 2 , 'name' =>'Name2' ),
'2' => array ('fid' => 1, 'tid' => 5 , 'name' =>'Name3' ),
'3' => array ('fid' => 1, 'tid' => 7 , 'name' =>'Name4' ),
'4' => array ('fid' => 3, 'tid' => 9, 'name' =>'Name5' )
);
$arr2 = array (
'0' => array (
'0' => array ( 'tid' => 1, 'name' => 'Name1'),
'1' => array ( 'tid' => 2, 'name' => 'Name2'),
'2' => array ( 'tid' => 5, 'name' => 'Name3'),
'3' => array ( 'tid' => 7, 'name' => 'Name4')
),
'1' => array (
'0' => array ( 'tid' => 9, 'name' => 'Name5' )
)
);
<?php
$arr1 = array (
'0' => array ('fid' => 1, 'tid' => 1, 'name' =>'Name1' ),
'1' => array ('fid' => 1, 'tid' => 2 , 'name' =>'Name2' ),
'2' => array ('fid' => 1, 'tid' => 5 , 'name' =>'Name3' ),
'3' => array ('fid' => 1, 'tid' => 7 , 'name' =>'Name4' ),
'4' => array ('fid' => 3, 'tid' =>


相关文档:

PHP+APACHE+MYSQL


copy F:\php\php5ts.dll F:\Apache2.2\bin\
copy F:\php\libmysql.dll F:\Apache2.2\bin\
copy F:\php\php.ini-recommended F:\php\php.ini
httpd:
LoadModule php5_module "F:\php\php5apache2_2.dll"
PHPIniDir "F:\php\php.ini"
AddType application/x-httpd-php .php
php.ini:
short_open_tag = Off 改成 sho ......

Linux + Apache2.0 + Mysql + PHP + phpBB3.0

 Linux + Apache2.0 + Mysql + PHP + phpBB3.0
 1.安包:
   Apache2.0
         #tar -zxf httpd-***.tar.gz -C /usr/local/src/
         #cd /usr/local/src/httpd-***
       ......

Windows XP下简单配置本机PHP调试环境


作为实现动态网站的工具之一,PHP以其语法简单、高效快速和对数据库的广泛支持而深受用户欢迎。编写PHP程序和ASP一样需要在本机调试,为此需要配置一下调试环境。
有很多方案可以选择,这里提供两种较为简易的方法。
不管是哪种方法,都需要安装PHP。如果你是PHP使用者,你可能在网上找过PHP的安装资讯,它们几乎都说的 ......

PCNTL函数族 PHP多进程编程

php有一组进程控制函数,使得php能在*nix系统中实现跟c一样的创建子进程、使用exec函数执行程序、处理信号等功能。
引用
Process Control support in PHP implements the Unix style of process creation, program execution, signal handling and process termination. Process Control should not be enabled within a ......

如何在PHP中使用Oracle数据库

http://www.builder.com.cn/2007/1027/583048.shtml
在php3.0以上版本中,php内置了几乎目前所有的数据库处理函数,包括Oracle;在本文中我们通过一个实例来介绍了如何使用这些函数来操作Oracle数据库。
PHP提供了2大类API(应用程序接口)来操作Oracle数据库。一个是标准的Oracle处理函数(ORA) 另一个是Oracle 8调用接口函 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号