标题:php循环数组输出HTML代码片段并对字符串进行base64编码 出处:刘新修 时间:Fri, 23 Oct 2015 14:03:37 +0000 作者:刘新修 地址:http://liuxinxiu.com:80/Jsonp_ArrayString_To_Base64_PHP/ 内容: PHP代码 *{margin:0;padding:0;}h1{font-size:16px;text-align:center; line-height:45px;}body{color:#333;font-size:14px;font-family:"MicrosoftYahei";background:#B7CACC;}div{border:1px solid #405E7B; border-bottom:0; width:95%; margin:0 auto;background:#fff;content:"";display:table;clear:both}li{line-height:35px;list-style:none;width:25%;text-align:center;border-bottom:1px solid #405E7B;float:left;}

最近风云人员名单

'; foreach($students as $v){ $tempBegin.=' '; } $tempEnd=$tempBegin.'
'; //echo $tempEnd; $str1=base64_encode($tempEnd); $str2='{"dataList":"'.$str1.'"}'; $jsonStr=$callback."(".$str2.")"; //判断请求参数存在就会输出Json数据 //if(isset($callback)&&!empty($callback)){ if(isset($callback)){ echo $jsonStr; } //判断请求参数不存在就输出错误信息 if(!isset($callback)){ header("Content-type: text/html; charset=utf-8"); $str="

400 Required String parameter '{$param}' is not present


http Request with error params: none callback function"; echo $str; } ?> Generated by Bo-blog 2.1.1 Release