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

PHP Array实用函数参考

array_flip
交换数组中的键和值
$arr1 = array('a'=>1,'b'=>2,'c'=>3,'d'=>4);
$array = array_flip($arr1);
showArr($array);
/*
Array
(
[1] => a
[2] => b
[3] => c
[4] => d
)
*/
array_key_exists
 
检查给定的键名或索引是否存在于数组中(也可用于对象)
 
$arr1 = array('a'=>1,'b'=>2,'c'=>3,'d'=>4);
echo array_key_exists('b',$arr1); //1 (true)
 
array_keys
 
返回数组中所有的键名
$arr1 = array('a'=>1,'b'=>2,'c'=>3,'d'=>4,5);
$array = array_keys($arr1);
showArr($array);
/*
Array
(
[0] => a
[1] => b
[2] => c
[3] => d
[4] => 0
)
*/
  


相关文档:

10 件(也许)你不了解 PHP 的事情

PHP
是我用过的语言中,最令人恼火的但同时也是最有趣的语言。我之所以说“令人恼火”主要是因为函数命名极其不一致。尽管我每天都要用到这些函数,我还是要想
一下“究竟是 str_pos 还是 strpos?是 str_split 还是
strsplit?”。另一方面,有时候可以用一行简单的代码就能解决一个难题。
下面 ......

PHP Floating point precision

Floating point precision
It is typical that simple decimal fractions like 0.1
or
0.7
cannot be converted into their internal binary
counterparts without a small loss of precision. This can lead to
confusing
results: for example, floor((0.1+0.7)*10)
will usually
return 7
......

配置Apache的访问目录(for PHP)

       在默认情况下,php的项目需要建在Apache Group\Apache\htdocs目录下才可以正常访问。当我们需要自己建立一个不在Apache Group\Apache\htdocs目录下的工作区间时,就需要改变Apache的访问指定路径。安装好Apache 后,在Apache Group\Apache\conf 下有一个文件httpd.conf,它里面包含着 ......

php mysql 配置php.ini

文件php.ini放入windows下,将下面内容拷贝到记事本命名为php.ini放入c:/windows下,重启Apache server:
[PHP]
;;;;;;;;;;;
; WARNING ;
;;;;;;;;;;;
; This is the default settings file for new PHP installations.
; By default, PHP installs itself with a configuration suitable for
; development purposes ......

php下载文件相关资料

当下载文件需要与服务端交互时,就需要用脚本来实现,而不是单纯地链接到文件的地址
下载mp3文件的例子
<?php
$file_path = './data/upload/song/sample.mp3';
$file_name = 'sample.mp3';
$file_size = filesize($file_path);
header ( "Pragma: public" );
header ( "Cache-Control: must-reval ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号