php Mod rewrite test
In the directory where you plan to install Elgg, do the following:
Create the file .htaccess and add these two lines
RewriteEngine on
RewriteRule ^testing.php$ modrewrite.php
This tells the webserver to load modrewrite.php when testing.php is
requested.
In order to get this test to work on some virtual servers, you
may need to add:
RewriteBase /
prior to the RewriteRule line.
Create the file modrewrite.php with this line
<?php echo "mod_rewrite works"; ?>
Create the file testing.php with this line
<?php echo "mod_rewrite does not work"; ?>
Now use your web browser to load testing.php. The text that shows will
tell you whether mod_rewrite is working
相关文档:
<?php
//声明数组变量
$arr = array('张三','李四','王五','李明');
//foreach循环遍历数组
foreach($arr as $value){
//注意“$value”后必须要一个空格,否则输出的结果不正确
echo "$value<br/>";
}
?> ......
编码是个很基础的问题,也是大家很容易忽略的问题,写代码之前多多考虑,以后会少很多麻烦。
PHP发展了不少,现在pear用起来很方便,其中就有相关的class来读取Excel文件里面的内容,如果不想使用pear的话,可以考虑使用excel_class.php,google一下,可以找到这个class的source code下载,也能找到基本的example c ......
原文链接:http://www.phpdo.net/index.php/20100410/55.html
在PHP中更新数组的内容可以直接指定键名并且对该键名赋值。 例如:
<?php
$php = array(“php”,”phpdo”,”phpdo.net”);
$php[2] = “www.phpdo.net”;
print_r($php);
&nbs ......
[转自]http://hi.baidu.com/xiamishule/blog/item/dea92c09ef9acc9e0b7b8236.html
源代码:
PHP获取IP的方法有许多种,<br />今天向大家总结了六种方法。
<br />PHP获取IP方法一:
<?php
function GetIP() {
if(!empty($_SERVER["HTTP_CLIENT_ ......
看yii框架源码的时候,发现了
ReflectionClass这个方法,才发现原来是php5的新东西,于是稍微研究了下。php的反射api一共有:
class
Reflection
{ }
interface Reflector
{ }
class
ReflectionException
extends
Exception
{ }
class
Re ......