| 14 |
liveuser |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
#宣告指派命名空間
|
|
|
4 |
namespace qbpwcf;
|
|
|
5 |
|
|
|
6 |
#匯入外部套件
|
|
|
7 |
include("../allInOne.php");
|
|
|
8 |
|
|
|
9 |
/*
|
|
|
10 |
|
|
|
11 |
#提示目前要測試的功能
|
|
|
12 |
echo"<hr>stringProcess::solveDotProblems - testCase 1<br>";
|
|
|
13 |
|
|
|
14 |
#涵式說明:
|
|
|
15 |
#將含有數個黑點的字串,處理成只剩下含有最後一個黑點的字串,結果會回傳合併後的字串。
|
|
|
16 |
#如果字串中沒有黑點則會回傳原始字串
|
|
|
17 |
#回傳的結果:
|
|
|
18 |
#$str,爲只剩下最後一個黑點的字串。
|
|
|
19 |
#輸入的參數:
|
|
|
20 |
$conf["stringIn"]="filename.dat";#爲要進行處理的字串。
|
|
|
21 |
var_dump(stringProcess::solveDotProblems($conf));
|
|
|
22 |
unset($conf);
|
|
|
23 |
|
|
|
24 |
*/
|
|
|
25 |
|
|
|
26 |
/*
|
|
|
27 |
|
|
|
28 |
#提示目前要測試的功能
|
|
|
29 |
echo"<hr>stringProcess::solveDotProblems - testCase 2<br>";
|
|
|
30 |
|
|
|
31 |
#涵式說明:
|
|
|
32 |
#將含有數個黑點的字串,處理成只剩下含有最後一個黑點的字串,結果會回傳合併後的字串。
|
|
|
33 |
#如果字串中沒有黑點則會回傳原始字串
|
|
|
34 |
#回傳的結果:
|
|
|
35 |
#$str,爲只剩下最後一個黑點的字串。
|
|
|
36 |
#輸入的參數:
|
|
|
37 |
$conf["stringIn"]="filename";#爲要進行處理的字串。
|
|
|
38 |
var_dump(stringProcess::solveDotProblems($conf));
|
|
|
39 |
unset($conf);
|
|
|
40 |
|
|
|
41 |
*/
|
|
|
42 |
|
|
|
43 |
/*
|
|
|
44 |
|
|
|
45 |
#提示目前要測試的功能
|
|
|
46 |
echo"<hr>stringProcess::solveDotProblems - testCase 3<br>";
|
|
|
47 |
|
|
|
48 |
#涵式說明:
|
|
|
49 |
#將含有數個黑點的字串,處理成只剩下含有最後一個黑點的字串,結果會回傳合併後的字串。
|
|
|
50 |
#如果字串中沒有黑點則會回傳原始字串
|
|
|
51 |
#回傳的結果:
|
|
|
52 |
#$str,爲只剩下最後一個黑點的字串。
|
|
|
53 |
#輸入的參數:
|
|
|
54 |
$conf["stringIn"]="filename.secondname.thirdname.log";#爲要進行處理的字串。
|
|
|
55 |
var_dump(stringProcess::solveDotProblems($conf));
|
|
|
56 |
unset($conf);
|
|
|
57 |
|
|
|
58 |
*/
|
|
|
59 |
|
|
|
60 |
/*
|
|
|
61 |
|
|
|
62 |
#提示目前要測試的功能
|
|
|
63 |
echo"<hr>stringProcess::solveDotProblems - testCase 4<br>";
|
|
|
64 |
|
|
|
65 |
#涵式說明:
|
|
|
66 |
#將含有數個黑點的字串,處理成只剩下含有最後一個黑點的字串,結果會回傳合併後的字串。
|
|
|
67 |
#如果字串中沒有黑點則會回傳原始字串
|
|
|
68 |
#回傳的結果:
|
|
|
69 |
#$str,爲只剩下最後一個黑點的字串。
|
|
|
70 |
#輸入的參數:
|
|
|
71 |
$conf["stringIn"]=".";#爲要進行處理的字串。
|
|
|
72 |
var_dump(stringProcess::solveDotProblems($conf));
|
|
|
73 |
unset($conf);
|
|
|
74 |
|
|
|
75 |
*/
|
|
|
76 |
|
|
|
77 |
/*
|
|
|
78 |
|
|
|
79 |
#提示目前要測試的功能
|
|
|
80 |
echo"<hr>stringProcess::solveDotProblems - testCase 5<br>";
|
|
|
81 |
|
|
|
82 |
#涵式說明:
|
|
|
83 |
#將含有數個黑點的字串,處理成只剩下含有最後一個黑點的字串,結果會回傳合併後的字串。
|
|
|
84 |
#如果字串中沒有黑點則會回傳原始字串
|
|
|
85 |
#回傳的結果:
|
|
|
86 |
#$str,爲只剩下最後一個黑點的字串。
|
|
|
87 |
#輸入的參數:
|
|
|
88 |
$conf["stringIn"]="";#爲要進行處理的字串。
|
|
|
89 |
var_dump(stringProcess::solveDotProblems($conf));
|
|
|
90 |
unset($conf);
|
|
|
91 |
|
|
|
92 |
*/
|
|
|
93 |
|
|
|
94 |
/*
|
|
|
95 |
|
|
|
96 |
#提示目前要測試的功能
|
|
|
97 |
echo"<hr>stringProcess::spiltString - testCase 1<br>";
|
|
|
98 |
|
|
|
99 |
#涵式說明:
|
|
|
100 |
#將固定格式的字串分開,並回傳分開的結果。
|
|
|
101 |
#如果裡面沒有半個分割用的符號則會回傳原始的字串。
|
|
|
102 |
#回傳的參數:
|
|
|
103 |
#$result["dataArray"],爲分割好字串的陣列內容,$result["dataArray"][$i]爲第($i+1)段的內容。
|
|
|
104 |
#$result["dataCounts"],爲總共分成幾段
|
|
|
105 |
#必填的參數:
|
|
|
106 |
$conf["stringIn"]="1,2,3,4,5,6,6,7,8,9";#要處理的字串。
|
|
|
107 |
$conf["spiltSymbol"]=",";#爲以哪個符號作爲分割
|
|
|
108 |
var_dump(stringProcess::spiltString($conf));
|
|
|
109 |
unset($conf);
|
|
|
110 |
|
|
|
111 |
*/
|
|
|
112 |
|
|
|
113 |
/*
|
|
|
114 |
|
|
|
115 |
#提示目前要測試的功能
|
|
|
116 |
echo"<hr>stringProcess::spiltString - testCase 2<br>";
|
|
|
117 |
|
|
|
118 |
#涵式說明:
|
|
|
119 |
#將固定格式的字串分開,並回傳分開的結果。
|
|
|
120 |
#如果裡面沒有半個分割用的符號則會回傳原始的字串。
|
|
|
121 |
#回傳的參數:
|
|
|
122 |
#$result["dataArray"],爲分割好字串的陣列內容,$result["dataArray"][$i]爲第($i+1)段的內容。
|
|
|
123 |
#$result["dataCounts"],爲總共分成幾段
|
|
|
124 |
#必填的參數:
|
|
|
125 |
$conf["stringIn"]="123456789";#要處理的字串。
|
|
|
126 |
$conf["spiltSymbol"]=",";#爲以哪個符號作爲分割
|
|
|
127 |
var_dump(stringProcess::spiltString($conf));
|
|
|
128 |
unset($conf);
|
|
|
129 |
|
|
|
130 |
*/
|
|
|
131 |
|
|
|
132 |
/*
|
|
|
133 |
|
|
|
134 |
#提示目前要測試的功能
|
|
|
135 |
echo"<hr>stringProcess::spiltString - testCase 3<br>";
|
|
|
136 |
|
|
|
137 |
#要處理的字串
|
|
|
138 |
$str="沒注意 0.111 1.000 9.00";
|
|
|
139 |
|
|
|
140 |
#將固定格式的字串分開,並回傳分開的結果。
|
|
|
141 |
#回傳的參數:
|
|
|
142 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
143 |
#$result["error"],錯誤訊息陣列
|
|
|
144 |
#$result["oriStr"],要分割的原始字串內容
|
|
|
145 |
#$result["dataArray"],爲分割好字串的陣列內容,$result["dataArray"][$i]爲第($i+1)段的內容。
|
|
|
146 |
#$result["dataCounts"],爲總共分成幾段
|
|
|
147 |
#必填的參數:
|
|
|
148 |
$conf["stringIn"]=$str;#要處理的字串。
|
|
|
149 |
$conf["spiltSymbol"]=" ";#爲以哪個符號作爲分割
|
|
|
150 |
var_dump(stringProcess::spiltString($conf));
|
|
|
151 |
unset($conf);
|
|
|
152 |
|
|
|
153 |
*/
|
|
|
154 |
|
|
|
155 |
/*
|
|
|
156 |
|
|
|
157 |
#提示目前要測試的功能
|
|
|
158 |
echo"<hr>stringProcess::spiltMutiString - testCase 1<br>";
|
|
|
159 |
|
|
|
160 |
#建立字串陣列
|
|
|
161 |
$stringArray[]="1,2,4,5,6,8,9";
|
|
|
162 |
$stringArray[]="good,best,bad,pop";
|
|
|
163 |
$stringArray[]="4,6,7,1,8,4,";
|
|
|
164 |
$stringArray[]="h,s,u,au,s,j,w";
|
|
|
165 |
|
|
|
166 |
#涵式說明:
|
|
|
167 |
#將多個固定格式的字串分開,並回傳分開的結果
|
|
|
168 |
#回傳的參數:
|
|
|
169 |
#$result[status],執行成功與否,若爲0,代表執行成功,若爲1代表執失敗。
|
|
|
170 |
#$result["spiltString"][$i]["dataArray"],爲第($i+1)個字串分割後的字串陣列
|
|
|
171 |
#$result["spiltString"][$i]["dataArray"][$j],爲第($i+1)的分割好的字串的第($j)段內容
|
|
|
172 |
#$result["spiltString"][$i]["dataCounts"],爲第($i+1)個字串分割後總共分成幾段
|
|
|
173 |
#必填的參數:
|
|
|
174 |
$conf["stringIn"]=$stringArray;#要處理的字串陣列。
|
|
|
175 |
$conf["spiltSymbol"]=",";#爲要以哪個符號作爲分割。
|
|
|
176 |
var_dump(stringProcess::spiltMutiString($conf));
|
|
|
177 |
unset($conf);
|
|
|
178 |
|
|
|
179 |
*/
|
|
|
180 |
|
|
|
181 |
/*
|
|
|
182 |
|
|
|
183 |
#提示目前要測試的功能
|
|
|
184 |
echo"<hr>stringProcess::StringToASCII - testCase 1<br>";
|
|
|
185 |
|
|
|
186 |
#涵式說明:
|
|
|
187 |
#將一字串的前幾個文字轉爲ACSII並存到陣列裏面
|
|
|
188 |
#回傳的結果:
|
|
|
189 |
#$result["dataCounts"],爲總共有幾個字轉好的ASCII陣列。
|
|
|
190 |
#$result["acsiiArray"],爲每個字轉好的ASCII陣列內容,$result["acsiiArray"][$i]爲第 $i+1 個字的ACSII內容。
|
|
|
191 |
#必填參數:
|
|
|
192 |
#$conf["stringIn"],字串,爲要處理的字串.
|
|
|
193 |
$conf["stringIn"]="person";
|
|
|
194 |
#可省略參數:
|
|
|
195 |
#$conf["wordsLong"],字串,爲要取得前幾個字元,若沒有要限定則可以不設定內容。
|
|
|
196 |
#$conf["wordsLong"]="";
|
|
|
197 |
var_dump(stringProcess::StringToASCII($conf));;
|
|
|
198 |
unset($conf);
|
|
|
199 |
|
|
|
200 |
*/
|
|
|
201 |
|
|
|
202 |
/*
|
|
|
203 |
|
|
|
204 |
#提示目前要測試的功能
|
|
|
205 |
echo"<hr>stringProcess::StringToASCII - testCase 2<br>";
|
|
|
206 |
|
|
|
207 |
#涵式說明:
|
|
|
208 |
#將一字串的前幾個文字轉爲ACSII並存到陣列裏面
|
|
|
209 |
#回傳的結果:
|
|
|
210 |
#$result["dataCounts"],爲總共有幾個字轉好的ASCII陣列。
|
|
|
211 |
#$result["acsiiArray"],爲每個字轉好的ASCII陣列內容,$result["acsiiArray"][$i]爲第 $i+1 個字的ACSII內容。
|
|
|
212 |
#必填參數:
|
|
|
213 |
#$conf["stringIn"],字串,爲要處理的字串.
|
|
|
214 |
$conf["stringIn"]="person";
|
|
|
215 |
#可省略參數:
|
|
|
216 |
#$conf["wordsLong"],字串,爲要取得前幾個字元,若沒有要限定則可以不設定內容。
|
|
|
217 |
$conf["wordsLong"]="3";
|
|
|
218 |
var_dump(stringProcess::StringToASCII($conf));;
|
|
|
219 |
unset($conf);
|
|
|
220 |
|
|
|
221 |
*/
|
|
|
222 |
|
|
|
223 |
/*
|
|
|
224 |
|
|
|
225 |
#提示目前要測試的功能
|
|
|
226 |
echo"<hr>stringProcess::stringIntToInt - testCase 1<br>";
|
|
|
227 |
|
|
|
228 |
#將數字字串轉換成實際的數字
|
|
|
229 |
#回傳的結果:
|
|
|
230 |
#$result,爲實際的數字。
|
|
|
231 |
#必填的參數:
|
|
|
232 |
$conf["stringIn"]="157999000";#要處理度數字字串。
|
|
|
233 |
var_dump(stringProcess::stringIntToInt($conf));
|
|
|
234 |
unset($conf);
|
|
|
235 |
|
|
|
236 |
*/
|
|
|
237 |
|
|
|
238 |
/*
|
|
|
239 |
|
|
|
240 |
#提示目前要測試的功能
|
|
|
241 |
echo"<hr>stringProcess::stringIntToInt - testCase 2<br>";
|
|
|
242 |
|
|
|
243 |
#將數字字串轉換成實際的數字
|
|
|
244 |
#回傳的結果:
|
|
|
245 |
#$result,爲實際的數字。
|
|
|
246 |
#必填的參數:
|
|
|
247 |
$conf["stringIn"]="080047899";#要處理度數字字串。
|
|
|
248 |
var_dump(stringProcess::stringIntToInt($conf));
|
|
|
249 |
unset($conf);
|
|
|
250 |
|
|
|
251 |
#*/
|
|
|
252 |
|
|
|
253 |
/*
|
|
|
254 |
|
|
|
255 |
#提示目前要測試的功能
|
|
|
256 |
echo"<hr>stringProcess::correctCharacter - testCase 1<br>";
|
|
|
257 |
|
|
|
258 |
#涵式說明:
|
|
|
259 |
#處理字串避免網頁出錯
|
|
|
260 |
#回傳的結果:
|
|
|
261 |
#$result,爲處理好的字串。
|
|
|
262 |
#必填的參數:
|
|
|
263 |
$conf["stringIn"]="<a href = http://google.com.tw></a><?php #這是註解 ?> \\ \r\n";#爲要處理的字串
|
|
|
264 |
#可省略的參數:
|
|
|
265 |
#$conf["selectedCharacter"]=array("");#爲被選擇要處理的字串/字元,須爲陣列值。
|
|
|
266 |
#若不設定則預設爲要將這些字串作替換("<" ">" ";" "=" "//" "'" "$" "%" "&" "|" "#" "/*" "*\/")。
|
|
|
267 |
#$conf["changeTo"]=array();#爲被選擇的字元要換成什麼字串字元,須爲陣列值。若不設定,則預設爲更換成""(空字串)。
|
|
|
268 |
var_dump(stringProcess::correctCharacter($conf));
|
|
|
269 |
unset($conf);
|
|
|
270 |
|
|
|
271 |
*/
|
|
|
272 |
|
|
|
273 |
/*
|
|
|
274 |
|
|
|
275 |
#提示目前要測試的功能
|
|
|
276 |
echo"<hr>stringProcess::correctCharacter - testCase 2<br>";
|
|
|
277 |
|
|
|
278 |
#涵式說明:
|
|
|
279 |
#處理字串避免網頁出錯
|
|
|
280 |
#回傳的結果:
|
|
|
281 |
#$result,爲處理好的字串。
|
|
|
282 |
#必填的參數:
|
|
|
283 |
$conf["stringIn"]="<a href = http://google.com.tw>google</a><?php #這是註解 ?> \\ \r\n";#爲要處理的字串
|
|
|
284 |
#可省略的參數:
|
|
|
285 |
$conf["selectedCharacter"]=array("");#爲被選擇要處理的字串/字元,須爲陣列值。
|
|
|
286 |
#若不設定則預設爲要將這些字串作替換("<" ">" ";" "=" "//" "'" "$" "%" "&" "|" "#" "/*" "*\/")。
|
|
|
287 |
#$conf["changeTo"]=array();#爲被選擇的字元要換成什麼字串字元,須爲陣列值。若不設定,則預設爲更換成""(空字串)。
|
|
|
288 |
var_dump(stringProcess::correctCharacter($conf));
|
|
|
289 |
unset($conf);
|
|
|
290 |
|
|
|
291 |
*/
|
|
|
292 |
|
|
|
293 |
/*
|
|
|
294 |
|
|
|
295 |
#提示目前要測試的功能
|
|
|
296 |
echo"<hr>stringProcess::correctMutiStrCharacter - testCase 1<br>";
|
|
|
297 |
|
|
|
298 |
#涵式說明:
|
|
|
299 |
#處理多個字串避免網頁出錯
|
|
|
300 |
#回傳的結果:
|
|
|
301 |
#$result["status"],"true"代表執行成功,"false"代表執行失敗。
|
|
|
302 |
#$result["error"],錯誤訊息
|
|
|
303 |
#$result["processedStrArray"],處理好的字串陣列
|
|
|
304 |
#必填的參數:
|
|
|
305 |
$conf["stringIn"]=array("Hello \t \n","\nHow are you","windows、linux");#爲要處理的字串陣列
|
|
|
306 |
#可省略的參數:
|
|
|
307 |
$conf["selectedCharacter"]=array("\t","\n");#爲被選擇要處理的字串/字元,須爲陣列值。
|
|
|
308 |
#若不設定則預設爲要將這些字串作替換("<",">",";","=","//","'","$","%","&","|","/*","*\/","#")。
|
|
|
309 |
#特殊字元,「\n」代表換行,「\t」代表tab鍵的間隔
|
|
|
310 |
#$conf["changeTo"]=array();#爲被選擇的字元要換成什麼字串/字元,須爲陣列值。若不設定,則預設爲更換成""(空字串)。
|
|
|
311 |
$result=stringProcess::correctMutiStrCharacter($conf);
|
|
|
312 |
unset($conf);
|
|
|
313 |
|
|
|
314 |
var_dump($result);
|
|
|
315 |
|
|
|
316 |
*/
|
|
|
317 |
|
|
|
318 |
/*
|
|
|
319 |
|
|
|
320 |
#提示目前要測試的功能
|
|
|
321 |
echo"<hr>stringProcess::changeDirByDotDotSolidus - testCase 1<br>";
|
|
|
322 |
|
|
|
323 |
#函式說明:
|
|
|
324 |
#根據 ../ 的數量(n)來將 檔案的目錄位置 回到上n層.
|
|
|
325 |
#回傳的結果:
|
|
|
326 |
#$result["status"],執行是否成功,"true"代表執行成功,"false"代表執行失敗.
|
|
|
327 |
#$result["error"],錯誤訊息陣列.
|
|
|
328 |
#$result["changedStr"],處理完後回傳的目錄字串.
|
|
|
329 |
#必填的參數:
|
|
|
330 |
#$conf["dirStr"],要處理的檔案目錄字串.
|
|
|
331 |
$conf["dirStr"]="/home/user/Documents/studentData/../101_2/OS/manual.odt";
|
|
|
332 |
var_dump(stringProcess::changeDirByDotDotSolidus($conf));
|
|
|
333 |
unset($conf);
|
|
|
334 |
|
|
|
335 |
*/
|
|
|
336 |
|
|
|
337 |
/*
|
|
|
338 |
|
|
|
339 |
#提示目前要測試的功能
|
|
|
340 |
echo"<hr>stringProcess::changeDirByDotDotSolidus - testCase 2<br>";
|
|
|
341 |
|
|
|
342 |
#函式說明:
|
|
|
343 |
#根據 ../ 的數量(n)來將 檔案的目錄位置 回到上n層.
|
|
|
344 |
#回傳的結果:
|
|
|
345 |
#$result["status"],執行是否成功,"true"代表執行成功,"false"代表執行失敗.
|
|
|
346 |
#$result["error"],錯誤訊息陣列.
|
|
|
347 |
#$result["changedStr"],處理完後回傳的目錄字串.
|
|
|
348 |
#必填的參數:
|
|
|
349 |
#$conf["dirStr"],要處理的檔案目錄字串.
|
|
|
350 |
$conf["dirStr"]="/home/user/../studentData/../101_2/OS/../manual.odt";
|
|
|
351 |
var_dump(stringProcess::changeDirByDotDotSolidus($conf));
|
|
|
352 |
unset($conf);
|
|
|
353 |
|
|
|
354 |
*/
|
|
|
355 |
|
|
|
356 |
/*
|
|
|
357 |
|
|
|
358 |
#提示目前要測試的功能
|
|
|
359 |
echo"<hr>stringProcess::changeDirByDotDotSolidus - testCase 3<br>";
|
|
|
360 |
|
|
|
361 |
#函式說明:
|
|
|
362 |
#根據 ../ 的數量(n)來將 檔案的目錄位置 回到上n層.
|
|
|
363 |
#回傳的結果:
|
|
|
364 |
#$result["status"],執行是否成功,"true"代表執行成功,"false"代表執行失敗.
|
|
|
365 |
#$result["error"],錯誤訊息陣列.
|
|
|
366 |
#$result["changedStr"],處理完後回傳的目錄字串.
|
|
|
367 |
#必填的參數:
|
|
|
368 |
#$conf["dirStr"],要處理的檔案目錄字串.
|
|
|
369 |
$conf["dirStr"]="/home/user/../studentData/../101_2/OS/../../manual.odt";
|
|
|
370 |
var_dump(stringProcess::changeDirByDotDotSolidus($conf));
|
|
|
371 |
unset($conf);
|
|
|
372 |
|
|
|
373 |
*/
|
|
|
374 |
|
|
|
375 |
/*
|
|
|
376 |
|
|
|
377 |
#提示目前要測試的功能
|
|
|
378 |
echo"<hr>stringProcess::changeDirByDotDotSolidus - testCase 4<br>";
|
|
|
379 |
|
|
|
380 |
#函式說明:
|
|
|
381 |
#根據 ../ 的數量(n)來將 檔案的目錄位置 回到上n層.
|
|
|
382 |
#回傳的結果:
|
|
|
383 |
#$result["status"],執行是否成功,"true"代表執行成功,"false"代表執行失敗.
|
|
|
384 |
#$result["error"],錯誤訊息陣列.
|
|
|
385 |
#$result["changedStr"],處理完後回傳的目錄字串.
|
|
|
386 |
#必填的參數:
|
|
|
387 |
#$conf["dirStr"],要處理的檔案目錄字串.
|
|
|
388 |
$conf["dirStr"]="../../../../public_html";
|
|
|
389 |
var_dump(stringProcess::changeDirByDotDotSolidus($conf));
|
|
|
390 |
unset($conf);
|
|
|
391 |
|
|
|
392 |
*/
|
|
|
393 |
|
|
|
394 |
/*
|
|
|
395 |
|
|
|
396 |
#提示目前要測試的功能
|
|
|
397 |
echo"<hr>stringProcess::combineElementWithSymbol - testCase 1<br>";
|
|
|
398 |
|
|
|
399 |
#函式說明:
|
|
|
400 |
#將陣列裡的元素內容用特定符號連接在一起變成字串.
|
|
|
401 |
#回傳的結果:
|
|
|
402 |
#$result["statu"],執行是否正常,"true"代表執行正常,"false"代表執行失敗
|
|
|
403 |
#$result["error"],錯誤訊息陣列.
|
|
|
404 |
#$result["content"],處理過後的字串.
|
|
|
405 |
#必填的字串:
|
|
|
406 |
#$conf["inputArray"],字串陣列,要處理的陣列.
|
|
|
407 |
$conf["stringProcess"]["combineElementWithSymbol"]["inputArray"]=array("A","B","C");
|
|
|
408 |
#$conf["combineSymbol"],字串,用來連結各元素的符號.
|
|
|
409 |
$conf["stringProcess"]["combineElementWithSymbol"]["combineSymbol"]=",";
|
|
|
410 |
var_dump(stringProcess::combineElementWithSymbol($conf["stringProcess"]["combineElementWithSymbol"]));
|
|
|
411 |
unset($conf["stringProcess"]["combineElementWithSymbol"]);
|
|
|
412 |
|
|
|
413 |
*/
|
|
|
414 |
|
|
|
415 |
/*
|
|
|
416 |
|
|
|
417 |
#提示目前要測試的功能
|
|
|
418 |
echo"<hr>stringProcess::spiltMutiLineString - testCase 1<br>";
|
|
|
419 |
|
|
|
420 |
#涵式說明:
|
|
|
421 |
#將多行內容的字串,依行切割
|
|
|
422 |
#回傳的參數:
|
|
|
423 |
#$result["status"],執行成功與否,若爲0,代表執行成功,若爲1代表執失敗。
|
|
|
424 |
#$result["oriStr"],要分割的原始字串內容
|
|
|
425 |
#$result["dataArray"],爲以行分割好的字串陣列內容,$result["dataArray"][$i]爲第($i+1)行的內容。
|
|
|
426 |
#$result["dataCounts"],爲總共分成幾行
|
|
|
427 |
#必填的參數:
|
|
|
428 |
$conf["stringIn"]="Hello\nWorld\nToday is a good dya!\nHow are you?";#要處理的多行文字字串。
|
|
|
429 |
#參考資料來源:
|
|
|
430 |
#http://dragonspring.pixnet.net/blog/post/33146613-%5blinux%5d%5btips%5d%e5%8e%bb%e9%99%a4dos%e6%aa%94%e6%a1%88%e8%a1%8c%e5%b0%be%e7%9a%84%5em => windows 與 linux 換行字元
|
|
|
431 |
var_dump(stringProcess::spiltMutiLineString($conf));
|
|
|
432 |
unset($conf);
|
|
|
433 |
|
|
|
434 |
*/
|
|
|
435 |
|
|
|
436 |
/*
|
|
|
437 |
|
|
|
438 |
#提示目前要測試的功能
|
|
|
439 |
echo"<hr>stringProcess::spiltMutiLineString - testCase 2<br>";
|
|
|
440 |
|
|
|
441 |
#涵式說明:
|
|
|
442 |
#將多行內容的字串,依行切割
|
|
|
443 |
#回傳的參數:
|
|
|
444 |
#$result["status"],執行成功與否,若爲0,代表執行成功,若爲1代表執失敗。
|
|
|
445 |
#$result["oriStr"],要分割的原始字串內容
|
|
|
446 |
#$result["dataArray"],爲以行分割好的字串陣列內容,$result["dataArray"][$i]爲第($i+1)行的內容。
|
|
|
447 |
#$result["dataCounts"],爲總共分成幾行
|
|
|
448 |
#必填的參數:
|
|
|
449 |
$conf["stringIn"]="Hello\r\nWorld\r\nToday is a good dya!\r\nHow are you?";#要處理的多行文字字串。
|
|
|
450 |
#參考資料來源:
|
|
|
451 |
#http://dragonspring.pixnet.net/blog/post/33146613-%5blinux%5d%5btips%5d%e5%8e%bb%e9%99%a4dos%e6%aa%94%e6%a1%88%e8%a1%8c%e5%b0%be%e7%9a%84%5em => windows 與 linux 換行字元
|
|
|
452 |
var_dump(stringProcess::spiltMutiLineString($conf));
|
|
|
453 |
unset($conf);
|
|
|
454 |
|
|
|
455 |
*/
|
|
|
456 |
|
|
|
457 |
/*
|
|
|
458 |
|
|
|
459 |
#提示目前要測試的功能
|
|
|
460 |
echo"<hr>stringProcess::str_split_unicode - testCase 1<br>";
|
|
|
461 |
|
|
|
462 |
#函式說明:
|
|
|
463 |
#unicode的字串分割,比str_split的支援度高.
|
|
|
464 |
#回傳結果:
|
|
|
465 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
466 |
#$result["error"],錯誤訊息陣列.
|
|
|
467 |
#$result["function"],當前執行的函數名稱.
|
|
|
468 |
#$result["content"],分割好的內容.
|
|
|
469 |
#$result["length"],unicode字串的長度.
|
|
|
470 |
#必填參數:
|
|
|
471 |
#$conf["str"],字串",要分割的字串.
|
|
|
472 |
$conf["str"]="│└─fedora-swap 2G";
|
|
|
473 |
#可省略參數:
|
|
|
474 |
#$conf["length"],整數,分割的長度.
|
|
|
475 |
#$conf["length"]=1;
|
|
|
476 |
#參考資料:
|
|
|
477 |
#http://php.net/manual/en/function.str-split.php
|
|
|
478 |
$str_split_unicode=stringProcess::str_split_unicode($conf);
|
|
|
479 |
unset($conf);
|
|
|
480 |
|
|
|
481 |
#如果執行失敗
|
|
|
482 |
if($str_split_unicode["status"]==="false"){
|
|
|
483 |
|
|
|
484 |
#印出內容
|
|
|
485 |
var_dump($str_split_unicode);
|
|
|
486 |
|
|
|
487 |
#結束程式
|
|
|
488 |
exit;
|
|
|
489 |
|
|
|
490 |
}#if end
|
|
|
491 |
|
|
|
492 |
#印出內容
|
|
|
493 |
var_dump($str_split_unicode);
|
|
|
494 |
|
|
|
495 |
*/
|
|
|
496 |
|
|
|
497 |
/*
|
|
|
498 |
|
|
|
499 |
#提示目前要測試的功能
|
|
|
500 |
echo"<hr>stringProcess::delStrBeforeKeyWord - testCase 1<br>";
|
|
|
501 |
|
|
|
502 |
#函式說明:
|
|
|
503 |
#將特定字串前面的內容剔除
|
|
|
504 |
#回傳結果:
|
|
|
505 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
506 |
#$result["error"],錯誤訊息陣列.
|
|
|
507 |
#$result["function"],當前執行的函數名稱.
|
|
|
508 |
#$result["oriStr"],要處理的原始字串內容.
|
|
|
509 |
#$result["content"],處理好的的字串內容.
|
|
|
510 |
#必填的參數:
|
|
|
511 |
$conf["stringIn"]="abcabcabcacbabc";#要處理的字串.
|
|
|
512 |
$conf["keyWord"]="cac";#特定字串.
|
|
|
513 |
var_dump(stringProcess::delStrBeforeKeyWord($conf));
|
|
|
514 |
unset($conf);
|
|
|
515 |
|
|
|
516 |
*/
|
|
|
517 |
|
|
|
518 |
/*
|
|
|
519 |
|
|
|
520 |
#提示目前要測試的功能
|
|
|
521 |
echo"<hr>stringProcess::delStrBeforeKeyWord - testCase 2<br>";
|
|
|
522 |
|
|
|
523 |
#函式說明:
|
|
|
524 |
#將特定字串前面的內容剔除
|
|
|
525 |
#回傳結果:
|
|
|
526 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
527 |
#$result["error"],錯誤訊息陣列.
|
|
|
528 |
#$result["function"],當前執行的函數名稱.
|
|
|
529 |
#$result["oriStr"],要處理的原始字串內容.
|
|
|
530 |
#$result["content"],處理好的的字串內容.
|
|
|
531 |
#必填的參數:
|
|
|
532 |
$conf["stringIn"]="ab";#要處理的字串.
|
|
|
533 |
$conf["keyWord"]="cac";#特定字串.
|
|
|
534 |
var_dump(stringProcess::delStrBeforeKeyWord($conf));
|
|
|
535 |
unset($conf);
|
|
|
536 |
|
|
|
537 |
*/
|
|
|
538 |
|
|
|
539 |
/*
|
|
|
540 |
|
|
|
541 |
#提示目前要測試的功能
|
|
|
542 |
echo"<hr>stringProcess::delStrBeforeKeyWord - testCase 3<br>";
|
|
|
543 |
|
|
|
544 |
#函式說明:
|
|
|
545 |
#將特定字串前面的內容剔除
|
|
|
546 |
#回傳結果:
|
|
|
547 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
548 |
#$result["error"],錯誤訊息陣列.
|
|
|
549 |
#$result["function"],當前執行的函數名稱.
|
|
|
550 |
#$result["oriStr"],要處理的原始字串內容.
|
|
|
551 |
#$result["content"],處理好的的字串內容.
|
|
|
552 |
#必填的參數:
|
|
|
553 |
$conf["stringIn"]="ababababababa";#要處理的字串.
|
|
|
554 |
$conf["keyWord"]="cac";#特定字串.
|
|
|
555 |
var_dump(stringProcess::delStrBeforeKeyWord($conf));
|
|
|
556 |
unset($conf);
|
|
|
557 |
|
|
|
558 |
*/
|
|
|
559 |
|
|
|
560 |
/*
|
|
|
561 |
|
|
|
562 |
#提示目前要測試的功能
|
|
|
563 |
echo"<hr>stringProcess::delStrBeforeKeyWord - testCase 4<br>";
|
|
|
564 |
|
|
|
565 |
#函式說明:
|
|
|
566 |
#將特定字串前面的內容剔除
|
|
|
567 |
#回傳結果:
|
|
|
568 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
569 |
#$result["error"],錯誤訊息陣列.
|
|
|
570 |
#$result["function"],當前執行的函數名稱.
|
|
|
571 |
#$result["oriStr"],要處理的原始字串內容.
|
|
|
572 |
#$result["content"],處理好的的字串內容.
|
|
|
573 |
#必填的參數:
|
|
|
574 |
$conf["stringIn"]="│ └─fedora-swap 2G";#要處理的字串.
|
|
|
575 |
$conf["keyWord"]="│ ";#特定字串.
|
|
|
576 |
var_dump(stringProcess::delStrBeforeKeyWord($conf));
|
|
|
577 |
unset($conf);
|
|
|
578 |
|
|
|
579 |
*/
|
|
|
580 |
|
|
|
581 |
/*
|
|
|
582 |
|
|
|
583 |
#提示目前要測試的功能
|
|
|
584 |
echo"<hr>stringProcess::delSameHead - testCase 1<br>";
|
|
|
585 |
|
|
|
586 |
#函式說明:
|
|
|
587 |
#移除多個字串開頭相同的部分
|
|
|
588 |
#回傳結果:
|
|
|
589 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
590 |
#$result["error"],錯誤訊息陣列.
|
|
|
591 |
#$result["function"],當前執行的函數名稱.
|
|
|
592 |
#$result["content"],處理好的的字串內容.
|
|
|
593 |
#必填的參數:
|
|
|
594 |
#$conf["strIn"],字串陣列,每個要處理的字串.
|
|
|
595 |
$conf["strIn"]=array("abcbac","abdde");
|
|
|
596 |
var_dump(stringProcess::delSameHead($conf));
|
|
|
597 |
unset($conf);
|
|
|
598 |
|
|
|
599 |
*/
|
|
|
600 |
|
|
|
601 |
/*
|
|
|
602 |
|
|
|
603 |
#提示目前要測試的功能
|
|
|
604 |
echo"<hr>stringProcess::delSameHead - testCase 2<br>";
|
|
|
605 |
|
|
|
606 |
#函式說明:
|
|
|
607 |
#移除多個字串開頭相同的部分
|
|
|
608 |
#回傳結果:
|
|
|
609 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
610 |
#$result["error"],錯誤訊息陣列.
|
|
|
611 |
#$result["function"],當前執行的函數名稱.
|
|
|
612 |
#$result["content"],處理好的的字串內容.
|
|
|
613 |
#必填的參數:
|
|
|
614 |
#$conf["strIn"],字串陣列,每個要處理的字串.
|
|
|
615 |
$conf["strIn"]=array("abcbac","abdde","bcsa");
|
|
|
616 |
var_dump(stringProcess::delSameHead($conf));
|
|
|
617 |
unset($conf);
|
|
|
618 |
|
|
|
619 |
*/
|
|
|
620 |
|
|
|
621 |
/*
|
|
|
622 |
|
|
|
623 |
#提示目前要測試的功能
|
|
|
624 |
echo"<hr>stringProcess::delStrAfterKeyWord - testCase 1<br>";
|
|
|
625 |
|
|
|
626 |
#函式說明:
|
|
|
627 |
#將字串特定關鍵字與其後面的內容剔除
|
|
|
628 |
#回傳結果:
|
|
|
629 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
630 |
#$result["error"],錯誤訊息陣列.
|
|
|
631 |
#$result["warning"],警告訊息鎮列.
|
|
|
632 |
#$result["founded"],有無找到定字串"true"代表有,"false"代表沒有.
|
|
|
633 |
#$result["function"],當前執行的函數名稱.
|
|
|
634 |
#$result["oriStr"],要處理的原始字串內容.
|
|
|
635 |
#$result["content"],處理好的的字串內容.
|
|
|
636 |
#必填的參數:
|
|
|
637 |
$conf["stringIn"]="127.0.0.1/~qbpwcf/AmazonLogin.php?token=123&scopr=profile";#要處理的字串.
|
|
|
638 |
$conf["keyWord"]="?token=";#特定字串.
|
|
|
639 |
var_dump(stringProcess::delStrAfterKeyWord($conf));
|
|
|
640 |
|
|
|
641 |
*/
|
|
|
642 |
|
|
|
643 |
/*
|
|
|
644 |
|
|
|
645 |
#提示目前要測試的功能
|
|
|
646 |
echo"<hr>stringProcess::delKeyWordsInStrHead - testCase 1<br>";
|
|
|
647 |
|
|
|
648 |
#涵式說明:
|
|
|
649 |
#移除字串開頭的特定內容
|
|
|
650 |
#回傳的接結果:
|
|
|
651 |
#$result["status"],寄信的情況,若爲"true",則十之八九沒有問題.
|
|
|
652 |
#$result["error"],錯誤訊息陣列.
|
|
|
653 |
#$result["function"],當前執行的函數.
|
|
|
654 |
#$result["content"],處理好的字串.
|
|
|
655 |
#必填的參數:
|
|
|
656 |
#$conf["inputStr"],字串,要檢查並移除開頭有 $conf["keyWords"] 的字串.
|
|
|
657 |
$conf["stringProcess::delKeyWordsInStrHead"]["inputStr"]="./abc";
|
|
|
658 |
#$conf["keyWord"],字串,要移除的字串開頭關鍵字.
|
|
|
659 |
$conf["stringProcess::delKeyWordsInStrHead"]["keyWord"]="./";
|
|
|
660 |
#可省略的參數:
|
|
|
661 |
#無.
|
|
|
662 |
var_dump(stringProcess::delKeyWordsInStrHead($conf["stringProcess::delKeyWordsInStrHead"]));
|
|
|
663 |
unset($conf["stringProcess::delKeyWordsInStrHead"]);
|
|
|
664 |
|
|
|
665 |
*/
|
|
|
666 |
|
|
|
667 |
/*
|
|
|
668 |
|
|
|
669 |
#提示目前要測試的功能
|
|
|
670 |
echo"<hr>stringProcess::parse - testCase 1<br>";
|
|
|
671 |
|
|
|
672 |
#函式說明:
|
|
|
673 |
#將字串進行解析,變成多個參數.
|
|
|
674 |
#回傳結果:
|
|
|
675 |
#$result["status"],執行正常與否,"false"代表不正常,"true"代表正常.
|
|
|
676 |
#$result["function"],當前執行的函式內容.
|
|
|
677 |
#$result["error"],錯誤訊息陣列.
|
|
|
678 |
#$result["content"],參數陣列.
|
|
|
679 |
#$result["count"],總共有幾個參數.
|
|
|
680 |
#必填參數:
|
|
|
681 |
#$conf["input"],字串,要解析成參數的字串.
|
|
|
682 |
$conf["input"]="";
|
|
|
683 |
$parse=stringProcess::parse($conf);
|
|
|
684 |
unset($conf);
|
|
|
685 |
|
|
|
686 |
#如果解析失敗
|
|
|
687 |
if($parse["status"]==="false"){
|
|
|
688 |
|
|
|
689 |
#印出內容
|
|
|
690 |
var_dump($parse);
|
|
|
691 |
|
|
|
692 |
#結束程式
|
|
|
693 |
exit;
|
|
|
694 |
|
|
|
695 |
}#if end
|
|
|
696 |
|
|
|
697 |
#印出內容
|
|
|
698 |
var_dump($parse);
|
|
|
699 |
|
|
|
700 |
*/
|
|
|
701 |
|
|
|
702 |
/*
|
|
|
703 |
|
|
|
704 |
#提示目前要測試的功能
|
|
|
705 |
echo"<hr>stringProcess::parse - testCase 2<br>";
|
|
|
706 |
|
|
|
707 |
#函式說明:
|
|
|
708 |
#將字串進行解析,變成多個參數.
|
|
|
709 |
#回傳結果:
|
|
|
710 |
#$result["status"],執行正常與否,"false"代表不正常,"true"代表正常.
|
|
|
711 |
#$result["function"],當前執行的函式內容.
|
|
|
712 |
#$result["error"],錯誤訊息陣列.
|
|
|
713 |
#$result["content"],參數陣列.
|
|
|
714 |
#$result["count"],總共有幾個參數.
|
|
|
715 |
#必填參數:
|
|
|
716 |
#$conf["input"],字串,要解析成參數的字串.
|
|
|
717 |
$conf["input"]="p1 p2 p3 p4";
|
|
|
718 |
$parse=stringProcess::parse($conf);
|
|
|
719 |
unset($conf);
|
|
|
720 |
|
|
|
721 |
#如果解析失敗
|
|
|
722 |
if($parse["status"]==="false"){
|
|
|
723 |
|
|
|
724 |
#印出內容
|
|
|
725 |
var_dump($parse);
|
|
|
726 |
|
|
|
727 |
#結束程式
|
|
|
728 |
exit;
|
|
|
729 |
|
|
|
730 |
}#if end
|
|
|
731 |
|
|
|
732 |
#印出內容
|
|
|
733 |
var_dump($parse);
|
|
|
734 |
|
|
|
735 |
*/
|
|
|
736 |
|
|
|
737 |
/*
|
|
|
738 |
|
|
|
739 |
#提示目前要測試的功能
|
|
|
740 |
echo"<hr>stringProcess::parse - testCase 3<br>";
|
|
|
741 |
|
|
|
742 |
#函式說明:
|
|
|
743 |
#將字串進行解析,變成多個參數.
|
|
|
744 |
#回傳結果:
|
|
|
745 |
#$result["status"],執行正常與否,"false"代表不正常,"true"代表正常.
|
|
|
746 |
#$result["function"],當前執行的函式內容.
|
|
|
747 |
#$result["error"],錯誤訊息陣列.
|
|
|
748 |
#$result["content"],參數陣列.
|
|
|
749 |
#$result["count"],總共有幾個參數.
|
|
|
750 |
#必填參數:
|
|
|
751 |
#$conf["input"],字串,要解析成參數的字串.
|
|
|
752 |
$conf["input"]="p1 p2 'p3-dasd' p4 'p5 sadsd'";
|
|
|
753 |
$parse=stringProcess::parse($conf);
|
|
|
754 |
unset($conf);
|
|
|
755 |
|
|
|
756 |
#如果解析失敗
|
|
|
757 |
if($parse["status"]==="false"){
|
|
|
758 |
|
|
|
759 |
#印出內容
|
|
|
760 |
var_dump($parse);
|
|
|
761 |
|
|
|
762 |
#結束程式
|
|
|
763 |
exit;
|
|
|
764 |
|
|
|
765 |
}#if end
|
|
|
766 |
|
|
|
767 |
#印出內容
|
|
|
768 |
var_dump($parse);
|
|
|
769 |
|
|
|
770 |
*/
|
|
|
771 |
|
|
|
772 |
/*
|
|
|
773 |
|
|
|
774 |
#提示目前要測試的功能
|
|
|
775 |
echo"<hr>stringProcess::clearStrSymbol - testCase 1<br>";
|
|
|
776 |
|
|
|
777 |
#函式說明:
|
|
|
778 |
#清除字串的「"」或「'」符號.
|
|
|
779 |
#回傳結果:
|
|
|
780 |
#剔除「"」或「'」符號後的字串.
|
|
|
781 |
$str="\"sccscsa dsdsf dsfdsfsd\"";
|
|
|
782 |
$clearStrSymbol=stringProcess::clearStrSymbol($str);
|
|
|
783 |
unset($str);
|
|
|
784 |
|
|
|
785 |
var_dump($clearStrSymbol);
|
|
|
786 |
|
|
|
787 |
*/
|
|
|
788 |
|
|
|
789 |
/*
|
|
|
790 |
|
|
|
791 |
#提示目前要測試的功能
|
|
|
792 |
echo"<hr>stringProcess::clearStrSymbol - testCase 2<br>";
|
|
|
793 |
|
|
|
794 |
#函式說明:
|
|
|
795 |
#清除字串的「"」或「'」符號.
|
|
|
796 |
#回傳結果:
|
|
|
797 |
#剔除「"」或「'」符號後的字串.
|
|
|
798 |
$str="'sccscsa dsdsf dsfdsfsd'";
|
|
|
799 |
$clearStrSymbol=stringProcess::clearStrSymbol($str);
|
|
|
800 |
unset($str);
|
|
|
801 |
|
|
|
802 |
var_dump($clearStrSymbol);
|
|
|
803 |
|
|
|
804 |
*/
|
|
|
805 |
|
|
|
806 |
/*
|
|
|
807 |
|
|
|
808 |
echo"<hr>sstringProcess::stringShift - testCase 1<br>";
|
|
|
809 |
|
|
|
810 |
#將固定格式的字串開頭移除一個,例如"a,b,c,null"變成"b,c,null"
|
|
|
811 |
#回傳結果:
|
|
|
812 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
813 |
#$result["error"],錯誤訊息陣列
|
|
|
814 |
#$result["function"],當前執行的函數名稱.
|
|
|
815 |
#$result["argu"],使用的參數.
|
|
|
816 |
#$result["dropElement"],被丟棄的元素.
|
|
|
817 |
#必填的參數:
|
|
|
818 |
#$conf["stringIn"]="";#要處理的字串。
|
|
|
819 |
$conf["stringIn"]="a,b,c,null";
|
|
|
820 |
#可省略參數:
|
|
|
821 |
#$conf["spiltSymbol"]="";#爲以哪個符號作爲分割,預設為",".
|
|
|
822 |
#$conf["spiltSymbol"]="";
|
|
|
823 |
$stringShift=stringProcess::stringShift($conf);
|
|
|
824 |
unset($conf);
|
|
|
825 |
|
|
|
826 |
#如果解析失敗
|
|
|
827 |
if($stringShift["status"]==="false"){
|
|
|
828 |
|
|
|
829 |
#印出內容
|
|
|
830 |
var_dump($stringShift);
|
|
|
831 |
|
|
|
832 |
#結束程式
|
|
|
833 |
exit;
|
|
|
834 |
|
|
|
835 |
}#if end
|
|
|
836 |
|
|
|
837 |
#印出內容
|
|
|
838 |
var_dump($stringShift);
|
|
|
839 |
|
|
|
840 |
*/
|
|
|
841 |
|
|
|
842 |
/*
|
|
|
843 |
|
|
|
844 |
echo"<hr>sstringProcess::stringShift - testCase 2<br>";
|
|
|
845 |
|
|
|
846 |
#將固定格式的字串開頭移除一個,例如"a,b,c,null"變成"b,c,null"
|
|
|
847 |
#回傳結果:
|
|
|
848 |
#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
|
|
|
849 |
#$result["error"],錯誤訊息陣列
|
|
|
850 |
#$result["function"],當前執行的函數名稱.
|
|
|
851 |
#$result["argu"],使用的參數.
|
|
|
852 |
#$result["dropElement"],被丟棄的元素.
|
|
|
853 |
#必填的參數:
|
|
|
854 |
#$conf["stringIn"]="";#要處理的字串。
|
|
|
855 |
$conf["stringIn"]="a,b,c,null";
|
|
|
856 |
#可省略參數:
|
|
|
857 |
#$conf["spiltSymbol"]="";#爲以哪個符號作爲分割,預設為",".
|
|
|
858 |
#$conf["spiltSymbol"]="";
|
|
|
859 |
#$conf["unshift"],字串,是否要改成丟棄最後一個元素,預設為"false";反之為"true".
|
|
|
860 |
$conf["unshift"]="true";stringShift
|
|
|
861 |
$stringShift=stringProcess::stringShift($conf);
|
|
|
862 |
unset($conf);
|
|
|
863 |
|
|
|
864 |
#如果解析失敗
|
|
|
865 |
if($stringShift["status"]==="false"){
|
|
|
866 |
|
|
|
867 |
#印出內容
|
|
|
868 |
var_dump($stringShift);
|
|
|
869 |
|
|
|
870 |
#結束程式
|
|
|
871 |
exit;
|
|
|
872 |
|
|
|
873 |
}#if end
|
|
|
874 |
|
|
|
875 |
#印出內容
|
|
|
876 |
var_dump($stringShift);
|
|
|
877 |
|
|
|
878 |
*/
|
|
|
879 |
|
|
|
880 |
?>
|