在 index.php 文件中定义 … '); require './ThinkPHP/ThinkPHP.php'; 使用后删
#!/usr/bin/php <?php error_reporting(E_ERROR); $toUser = $
被nginx调用的php-fpm服务,如果 … 连接出去则php-fpm的9000端口
配置文件 config.php 中加上这一
导入: :r /etc/demo.php 导入文件 :r
filter_var() 一个过滤函数 $email = "1234@163.com"; var_dump(filter_var($email, FILTER_VALIDATE_EMAIL)); 正确返回邮箱地址,错误返回false ThinkPHP里面使用方法 array('url','filter_var','地址格式不符',self::EXISTS_VALIDATE,'function',self::MODEL_ ...
ab -c 200 -n 1000 http://192.168.96.130/index.php -c 并发量 -n 请求数
preg_replace(array('/<[^>]*>/', '/( )+/', '/\s+/'), ' ', $content)
页: DirectoryIndex index.html index.php 指定文档路
$month = 6; echo str_pad($month, 2, 0, STR_PAD_LEFT); echo sprintf('%02s', $month);
for ($i = 0x08000; $i >= 0x00010; $i >>= 1){ echo $i; // 这样直接输出的是十进制,而不是16进制 base_convert($i, 10, 2); // 转换也要用十进制转二进制 echo 0x04bd8 & $i ? 1 : 0 ; // 但是可以和十六进制进行与运算 echo "<br>"; }
mb_internal_encoding('UTF-8'); 设置内部编码 mb_convert_encoding() 转换编码 mb_substr() 剪切字符串 mb_strpos() 查找某个字符串第一次出现的位置 mb_strlen() 获取字符串长度
$file = fopen("Minot.txt", "r") ; while(!feof($file)) { echo fgets($file); } fclose($file);
用程序代码 (PHP): // only search posts by author
strstr(string,char,[boolean]) //在string中查找并返回char之后的字符串,boolean等于true 返回之前部分 第三个参数为true返回之前的字符串 找的是char在string中最先出现的字符
/** * sphinx搜索 * @param string $word 搜索的词 * @param int $id 要去掉的ID * @param int $number 取出的数目 * @return array $list 数据列表 */ function sphinx_search($word,$id,$number = 10,$heightlight = false){ if($word) { $word = str_replace(array(',',',' ...
public function search() { if($_POST['s']) { $word = $_POST['s']; $sphinx = new \SphinxClient (); $sphinx->SetServer ( '127.0.0.1', 9312); $sphinx->SetConnectTimeout ( 3 ); $sphinx->SetArrayResult ( true ); $sphinx-> ...
; \> 其他类似PHP正则 grep -E = egrep
header("Content-type: Content-type:application/vnd.ms-excel"); header("Accept-Ranges: bytes"); header("Content-Disposition:attachment; filename=".$filename); header("Content-length:".strlen($string)); 更多详见: http:// ...
$str = '搜索加勒比海盗'; header('content-type:text/html;charset=utf-8'); mb_internal_encoding('UTF-8');//设置内部编码 $condition = mb_substr($str, 0, 2); echo $condition;