我遇到的有下面這三種錯誤訊息:
- PHP Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Chongqing' for 'CST/8.0/no DST' instead in /tmp/a.php
<?php
$str = 'Hello';
print_r(str_split($str)); // array('H', 'e', 'l', 'l', 'o')
print_r(str_split($str, 3)); // array('Hel', 'lo')
?>
str_split() 可以將 字串 依 需要的長度 做分割, 但是對 UTF-8 的中文, 就無法切依需要的長度來做切割, 要自己另外處理.
- $db->select('*')->limit(10)->begin(0) ... 等等. (在操作上(Method), 可以一直 "->" 的操作下去.)
- 執行順序:
- select('*')
- limit(10)
- begin(0)
会汉语就会编,专业php中文编程工具 phpcn 4.2 真正的php中文开发工具
- By HKPUG .NET
- Published 3 January 2010
- PHP
- Unrated
- | No. of Views: 88
V4.2版 更新说明
1、修正了4.0版的错误
2、更新了远程PHP调试功能
(该功能可在没有装php服务器的机器上直接调试php程序)
3、更正了会修改首页的bug,现在绝不会修改首页了。
4、本版本是目前功能最完善,最稳定的版本
15:31 2010-1-2
V4.0版 更新说明
1、启动最大化窗口
2、增加调试出错自动跳转到出错行。
範例程式
使用字型: /usr/share/fonts/truetype/arphic/bkai00mp.ttf
下述程式會產生 800 x 600 的圖片, 用 bkai00mp.ttf 來將 "今天天氣真好\n是旅遊的好天氣" 的 text 內容, 變成圖片.
程式 與 XML 內容
<?php
$string = <<<XML
<?xml version='1.0'?>
<document responsecode="200">
<result count="10" start="0" totalhits="133047950">
<title>Test</title>
<from>Jon</from>
<to>Tsung</to>
</result>
</document>
XML;
$xml = simplexml_load_string($string);
print_r($xml);
?>
若能同時間去抓取多個網頁, 所花費的時間 5,10,7,5 秒, 全部總合所花的時間是 10 秒.(花費最多時間的秒數)
範例
<?php
$alist = array(
'2009' => '11',
'聖誕節' => '22',
'2098' => '11',
'111a' => '33',
);
$output = array_slice($alist, 0, 2);
print_r($output);
?>
範例 - 使用 array_merge
<?php
$a1 = array(
'9' => '0',
'311' => '1',
'快樂' => '2',
'2009a' => '3');
$a2 = array(
'2009' => '11',
'聖誕節' => '22',
'111a' => '33');
$amerge = array();
$amerge = array_merge($a1, $a2);
print_r($amerge);
?>