php dump utfp,php pchart乱码-使用REST接口获取GeoServer中的...-结合 thinkPHP 分页写成自己分页类_169IT.COM...
本頁文章導讀:
?php pchart亂碼??????有倆種情況:①:未將中文字符編碼格式修改成utf-8 (例子如下:)mb_convert_encoding($data, "html-entities","utf-8" ); ?②:字體庫出現問題 (請使用simhei.ttf字體 此字體大小為9.57 MB左右)simhei.ttf的下載.........
?使用REST接口獲取GeoServer中的圖層列表??????最近在工作的過程中,有一個需求是在外部程序中對GeoServer進行管理操作,通過查閱資料發現GeoServer的REST接口可以滿足需求。REST接口使用HTTP調用的方式,無需登錄Web管理界面就可以對Geo.........
?結合 thinkPHP 分頁寫成自己分頁類??????1 <?php 2 // +---------------------------------------------------------------------- 3 // | 參考 ThinkPHP 分頁類改變而來 4 // +---------------------------------------------------------------------- 5 // | 有兩種樣式:1、當.........
[1]php pchart亂碼
來源:? 發布時間:?2013-11-07
有倆種情況:
①:未將中文字符編碼格式修改成utf-8 (例子如下:)
mb_convert_encoding($data, "html-entities","utf-8" );
②:字體庫出現問題 (請使用simhei.ttf字體 此字體大小為9.57 MB左右)
simhei.ttf的下載地址(我驗證過,有效且可用):
http://ishare.iask.sina.com.cn/f/12351604.html?from=like
本文鏈接
[2]使用REST接口獲取GeoServer中的圖層列表
來源:? 發布時間:?2013-11-07
最近在工作的過程中,有一個需求是在外部程序中對GeoServer進行管理操作,通過查閱資料發現GeoServer的REST接口可以滿足需求。REST接口使用HTTP調用的方式,無需登錄Web管理界面就可以對GeoServer進行簡單的調用和配置。
GeoServer官網對REST的配置API和示例的介紹地址為:http://docs.geoserver.org/stable/en/user/rest/index.html
下面的程序通過使用REST接口,請求GeoServer中圖層的列表。
$url = "http://localhost:8180/geoserver/rest/layers/";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);//設置為true,表示獲取的內容以字符串的形式返回
curl_setopt($ch, CURLOPT_VERBOSE, true);//設置為true,返回執行過程中的異常
curl_setopt($ch, CURLOPT_GET, True);
$passwordStr = "admin:geoserver";//geoserver的用戶名:密碼
curl_setopt($ch, CURLOPT_USERPWD, $passwordStr);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept:application/json"));//HTTP請求頭信息
$successCode = 200;
$buffer = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);
if($info['http_code'] != $successCode){
$msgStr = "請求失敗!";
echo $msgStr;
}else{
$output_array = json_decode($buffer, true);
$layer_infos = $output_array['layers']['layer'];
foreach($layer_infos as $k => $v){
$layer_names[] = $v['name'];
}
echo json_encode($layer_names);
}
?>
博客聲明:
本博客中的所有文章,除標題中注明“轉載”字樣外,其余所有文章均為本人原創或在查閱資料后總結完成,引用非轉載文章時請注明此聲明。—— 博客園-pallee
本文鏈接
[3]結合 thinkPHP 分頁寫成自己分頁類
來源:? 發布時間:?2013-11-07
1 <?php
2 // +----------------------------------------------------------------------
3 // | 參考 ThinkPHP 分頁類改變而來
4 // +----------------------------------------------------------------------
5 // | 有兩種樣式:1、當面頁碼始終在中間。 2、當點到分頁條兩邊的頁碼時,自動翻頁(默認)。
6 // +----------------------------------------------------------------------
7 // | Author: zbseoag
8 // +----------------------------------------------------------------------
9 // $Id: page.class.php 2013-05-26 00:08:49
10
11 session_start(); //由于要記錄用戶是向前,還是向后翻頁,故啟用了session
12
13 class Page{
14
15 public $page; //當前頁
16 public $nextPage; //上一頁
17 public $prevPage; //下一頁
18 public $pageMax; //最大頁
19 public $startPage; //分頁條起碼
20 public $endPage; // 分頁條止碼
21 public $style; //樣式:$style = mid
22 public $parameter;//頁數跳轉時要帶的參數
23 protected $varPage;//默認分頁變量名
24 protected $config = array(
25 'header'=>'條記錄','prev'=>'上一頁','next'=>'下一頁','first'=>'首頁','last'=>'尾頁',
26 'theme' => '%records% %header% %page%/%pageMax% 頁 %firstPage%%prevPage%%linkPage%%nextPage%%lastPage%'
27 );
28
29 /**
30 +----------------------------------------------------------
31 * 架造函數
32 +----------------------------------------------------------
33 * @param $records 總的記錄數
34 * @param $pageSize 每頁顯示記錄數
35 * @param $parameter 分頁跳轉的參數
36 +----------------------------------------------------------
37 */
38
39 function __construct($records, $pageSize, $pageVal = 'p', $parameter = null){
40
41 $this->records = $records;
42 $this->pageMax = ceil($records/$pageSize);
43 $this->page= max(intval($_GET[$pageVal]), 1); //最小為1
44 $this->page = min($this->page, $this->pageMax); //最大為末頁
45 $this->nextPage = $this->page + 1;
46 $this->prevPage = $this->page - 1;
47 $this->varPage = $pageVal; //默認分頁變量名
48 $this->parameter = $parameter;
49 }
50
51 /**
52 +----------------------------------------------------------
53 * 設置樣式
54 +----------------------------------------------------------
55 * @param $name 內置參數名
56 * @param $value 給定參數值
57 +----------------------------------------------------------
58 */
59 function setConfig($name, $value){
60 if(isset($this->config
最新技術文章:
 
總結
以上是生活随笔為你收集整理的php dump utfp,php pchart乱码-使用REST接口获取GeoServer中的...-结合 thinkPHP 分页写成自己分页类_169IT.COM...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 社保要备案吗怎么办理(社保要备案吗)
- 下一篇: 安卓弹广告不知道是哪个软件(安卓弹广告)