拥有PHP标签的文章

curl获取远程数据

/**  * 使用curl获取远程数据  * @param  string $url url连接  * @return string      获取到的数据  */ function curl_get
阅读全文

XML转Array

function toArray($xml){     //禁止引用外部xml实体     libxml_disable_entity_loader(true);     $result= json_decode(json_encode(simplexm
阅读全文

删除文件和文件夹

function delDirAndFile($path, $delDir = FALSE) {     $handle = opendir($path);     if ($handle) {   &n
阅读全文

隐藏tp中的index.php

在config文件中添加以下配置:(application/common/conf/config.php)'URL_CASE_INSENSITIVE' => true,//REWRITE模式'URL_MODEL' => 2,根目录.htaccess如果没有自己建也可以<IfModule mod_re
阅读全文

unicode与中文互转

/**  * 将内容进行UNICODE编码,如中文字符串"图片" 转为"\u56fe\u7247"  * @param string $name 要转换的中文字符串  * @param string $in_charset 
阅读全文

对于数组指针的控制PHP提供了以下几个内建函数

  • Barley
  • 2018-09-15 12:16:23
  • PHP
  • PHP
current():取得目前指针位置的内容资料。   key():读取目前指针所指向资料的索引值(键值)。   next():将数组中的内部指针移动到下一个单元。   prev():将数组的内部指针倒回一位。   end():将数组的内部指针指向最后一个元素。   reset():将目前指针无条件移至第一个索
阅读全文

strcmp函数

  • Barley
  • 2018-09-14 15:44:13
  • PHP
  • PHP
用来比较两个字符串的大小。如果$str1 = $str2等于返回0 如果$str1<$str2那么返回'两个字符串不同的字符'的负数(4个不一样就是-4) 如果$str1>$str2那么返回'两个字符串不同的字符'的整数(4个不一样就是4)提示:该函数与 strncmp() 函数类似,不同的是,通过 strnc
阅读全文

使用curl获取远程数据

  • Barley
  • 2018-09-01 15:19:27
  • PHP
  • PHP
/**  * 使用curl获取远程数据  * @param  string $url url连接  * @return string      获取到的数据  */ function curl_get
阅读全文

php删除文件和文件夹

  • Barley
  • 2018-09-01 15:18:55
  • PHP
  • PHP
/**  * 删除文件和文件夹  */ function delDirAndFile($path, $delDir = FALSE) {     $handle = opendir($path);     
阅读全文

xml转数组

  • Barley
  • 2018-09-01 15:18:11
  • PHP
  • PHP
function toArray($xml){     //禁止引用外部xml实体     libxml_disable_entity_loader(true);     $result= json_decode(json_encode(simplexm
阅读全文