随笔分类 - PHP
摘要:valid();class wechatCallbackapiTest{ public function valid() { $echoStr = $_GET["echostr"]; //valid signature , option if($...
阅读全文
摘要:php获取post参数的几种方式1、$_POST['paramName'] 只能接收Content-Type: application/x-www-form-urlencoded提交的数据2、file_get_contents("php://input") 适用大多数类型的Content-typep...
阅读全文
摘要:/** * 截取HTML,并自动补全闭合 * @param $html * @param $length * @param $end */function subHtml($html,$length,$charset) { $result = ''; $tagStack = array(...
阅读全文
摘要:function getfirstchar($s0){ $fchar = ord($s0{0}); if($fchar >= ord("A") and $fchar = -20319 and $asc = -20283 and $asc = -19775 and $asc = -19218 and $asc = -18710 and $asc = -18526 and $asc = -18239 and $asc = -17922 and $asc = -17417 and $asc = -16474 and $asc = -16212 and $asc = -156
阅读全文
摘要:$con = file_get_contents("http://v.guozitv.com/api/androidxml.php?"); $data = simplexml_load_string($con); print_r($data); echo $data->details; exit;$doc = new DOMDocument();$doc->load( $xgweb );$books = $doc->getElementsByTagName( "item" );foreach( $books as $book ){ $a
阅读全文
摘要:/** * 获取替换文章中的图片路径 * @param string $xstr 内容 * @param string $keyword 创建照片的文件名 * @param string $oriweb 网址 * @return string * */function replaceimg($xstr,$keyword, $oriweb){ //保存路径 $d = date('Ymd', time()); $dirslsitss = '/var/www/weblist/uploads/'.$keyword.'/'.$d;//分类是否存在 if(!
阅读全文
摘要:/** * 取出html标签 * * @access public * @param string str * @return string * */function deletehtml($str) { $str = trim($str); //清除字符串两边的空格 $str = strip_tags($str,""); //利用php自带的函数清除html格式。保留P标签 $str = preg_replace("/\t/","",$str); //使用正则表达式匹配需要替换的内容,如:空格,换行,并将替换为空。 $str = p
阅读全文
摘要:echo json_decode('"\u4e2d"');exit;
阅读全文
摘要:换行符unix系列用 \nwindows系列用 \r\nmac用 \rPHP中可以用PHP_EOL来替代,以提高代码的源代码级可移植性
阅读全文
浙公网安备 33010602011771号