Subversion Repositories php-qbpwcf

Rev

Rev 3 | Rev 165 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3 Rev 66
Line 4115... Line 4115...
4115
	#$result["content"],陣列,若為n個${*},則當found為"true"時,就會回傳n個元素.
4115
	#$result["content"],陣列,若為n個${*},則當found為"true"時,就會回傳n個元素.
4116
	#$result["parsedVar"][varName],陣列,解析好的變數陣列,varName為${}中的內容.
4116
	#$result["parsedVar"][varName],陣列,解析好的變數陣列,varName為${}中的內容.
4117
	#必填參數:
4117
	#必填參數:
4118
	#$conf["input"],字串,要檢查的字串.
4118
	#$conf["input"],字串,要檢查的字串.
4119
	$conf["input"]="";
4119
	$conf["input"]="";
4120
	#$conf["format"],格式字串,要尋找的格式字串.格式為固定的字串("fixedStr format")與變數(${keyWordVarName})組成.
4120
	#$conf["format"],格式字串,要尋找的格式字串.格式為固定的字串("fixedStr format")與變數("${keyWordVarName}")組成.
4121
	$conf["format"]="";
4121
	$conf["format"]="";
4122
	#可省略參數:
4122
	#可省略參數:
-
 
4123
	#$conf["varEqual"],陣列,變數對應的數值,null代表不指定,其他內容代表該變數解析出來必須要為該內容.
-
 
4124
	#$conf["varEqual"]=array(null,"found");
4123
	#無.
4125
	#$conf["varCon"],陣列,每個varEqual為null者,其是否有其他條件,預設為null代表無其他條件,條件的表示是用陣列的key與value來表達,例如:array("no_tail"=>" not"),就代表變數的結尾不能為" not",可以用的key有"head",代表開頭要有什麼;"no_head",代表不能為什麼開頭;"tail",代表要什麼結尾;"no_tail",代表不能什麼結尾.
-
 
4126
	#$conf["varCon"]=array("no_tail"=>" not");
4124
	#參考資料:
4127
	#參考資料:
4125
	#無.
4128
	#無.
4126
	#備註:
4129
	#備註:
4127
	#目前失效?
4130
	#無.
4128
	*/
4131
	*/
4129
	public static function findSpecifyStrFormat(&$conf){
4132
	public static function findSpecifyStrFormat(&$conf){
4130
	
4133
	
4131
		#初始化要回傳的結果
4134
		#初始化要回傳的結果
4132
		$result=array();
4135
		$result=array();
Line 4206... Line 4209...
4206
		#$conf["canBeEmpty"],字串陣列,哪些必填參數的內容可為空字串或空陣列,僅當$conf["canBeEmptyString"]為"false"時會生效.
4209
		#$conf["canBeEmpty"],字串陣列,哪些必填參數的內容可為空字串或空陣列,僅當$conf["canBeEmptyString"]為"false"時會生效.
4207
		#$conf["canBeEmpty"]=array();
4210
		#$conf["canBeEmpty"]=array();
4208
		#$conf["skipableVariableCanNotBeEmpty"],字串陣列,哪些可省略參數不可以為空字串或空陣列.
4211
		#$conf["skipableVariableCanNotBeEmpty"],字串陣列,哪些可省略參數不可以為空字串或空陣列.
4209
		#$conf["skipableVariableCanNotBeEmpty"]=array();
4212
		#$conf["skipableVariableCanNotBeEmpty"]=array();
4210
		#$conf["skipableVariableName"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
4213
		#$conf["skipableVariableName"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
4211
		#$conf["skipableVariableName"]=array();
4214
		$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("varEqual","varCon");
4212
		#$conf["skipableVariableType"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
4215
		#$conf["skipableVariableType"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
4213
		#$conf["skipableVariableType"]=array();
4216
		$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("array","array");
4214
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null與代表不指定,若預設值是參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
4217
		#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null與代表不指定,若預設值是參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
4215
		#$conf["skipableVarDefaultValue"]=array("");
4218
		$conf["variableCheck::checkArguments"]["skipableVarDefaultValue"]=array(null,null);
4216
		#$conf["disallowAllSkipableVarIsEmpty"],字串,是否允許每個可省略參數都為空字串,預設為"true"允許,反之為"false".
4219
		#$conf["disallowAllSkipableVarIsEmpty"],字串,是否允許每個可省略參數都為空字串,預設為"true"允許,反之為"false".
4217
		#$conf["disallowAllSkipableVarIsEmpty"]="";
4220
		#$conf["disallowAllSkipableVarIsEmpty"]="";
4218
		#$conf["disallowAllSkipableVarIsEmptyArray"],字串,是否允許每個可省略參數都為空陣列,預設為"true"允許,反之為"false".
4221
		#$conf["disallowAllSkipableVarIsEmptyArray"],字串,是否允許每個可省略參數都為空陣列,預設為"true"允許,反之為"false".
4219
		#$conf["disallowAllSkipableVarIsEmptyArray"]="";
4222
		#$conf["disallowAllSkipableVarIsEmptyArray"]="";
4220
		#$conf["disallowAllSkipableVarNotExist"],字串,是否不允許每個可省略參數都不存在,預設為"false"代表允許,反之為"true".
4223
		#$conf["disallowAllSkipableVarNotExist"],字串,是否不允許每個可省略參數都不存在,預設為"false"代表允許,反之為"true".
4221
		#$conf["disallowAllSkipableVarNotExist"]="";
4224
		#$conf["disallowAllSkipableVarNotExist"]="";
4222
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
4225
		#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
4223
		#$conf["arrayCountEqualCheck"][]=array();
4226
		#$conf["variableCheck::checkArguments"]["arrayCountEqualCheck"][]=array("varEqual","varCon");
4224
		#參考資料:
4227
		#參考資料:
4225
		#array_keys=>http://php.net/manual/en/function.array-keys.php
4228
		#array_keys=>http://php.net/manual/en/function.array-keys.php
4226
		#備註:
4229
		#備註:
4227
		#無.
4230
		#無.
4228
		$checkArguments=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
4231
		$checkArguments=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
Line 4255... Line 4258...
4255
			return $result;
4258
			return $result;
4256
		
4259
		
4257
			}#if end
4260
			}#if end
4258
		
4261
		
4259
		#另存一份input
4262
		#另存一份input
4260
		$modifiedInput=$conf["input"];	
4263
		$modifiedInput=$conf["input"];
4261
			
4264
			
4262
		#預設分段的關鍵字為空
4265
		#預設分段的關鍵字為空
4263
		$keyWordPart=array();
4266
		$keyWordPart=array();
4264
		
4267
		
4265
		#預設該行的變數為空
4268
		#預設該行的變數為空
Line 4508... Line 4511...
4508
					#回傳結果
4511
					#回傳結果
4509
					return $result;
4512
					return $result;
4510
				
4513
				
4511
					}#if end
4514
					}#if end
4512
				
4515
				
-
 
4516
				#debug
-
 
4517
				#var_dump(__LINE__,$delStrBeforeKeyWord);
-
 
4518
				
4513
				#取得剩下的格式字串部分
4519
				#取得剩下的格式字串部分
4514
				$conf["format"]=$delStrBeforeKeyWord["content"];
4520
				$conf["format"]=$delStrBeforeKeyWord["content"];
4515
				
4521
				
4516
				#暫存的關鍵字資訊
4522
				#暫存的關鍵字資訊
4517
				$tmp=array("name"=>"varPart","index"=>count($varPart)-1,"value"=>$varPart[count($varPart)-1]);
4523
				$tmp=array("name"=>"varPart","index"=>count($varPart)-1,"value"=>$varPart[count($varPart)-1]);
Line 4522... Line 4528...
4522
				}#if end
4528
				}#if end
4523
		
4529
		
4524
			#反之
4530
			#反之
4525
			else{
4531
			else{
4526
			
4532
			
-
 
4533
				#若有剩下的內容
-
 
4534
				if(!empty($conf["format"])){
-
 
4535
				
-
 
4536
					#儲存剩下的內容為關鍵字之一
-
 
4537
					$keyWordPart[]=$conf["format"];
-
 
4538
				
-
 
4539
					#暫存的關鍵字資訊
-
 
4540
					$tmp=array("name"=>"keyWordPart","index"=>count($keyWordPart)-1,"value"=>$keyWordPart[count($keyWordPart)-1]);
-
 
4541
 
-
 
4542
					#設置順序資訊
-
 
4543
					$OderOfPartInLine[]=$tmp;
-
 
4544
				
-
 
4545
					}#if end
-
 
4546
			
4527
				#結束格式字串的解析
4547
				#結束格式字串的解析
4528
				break;
4548
				break;
4529
			
4549
			
4530
				}#else end
4550
				}#else end
4531
		
4551
		
Line 4538... Line 4558...
4538
		if( count($OderOfPartInLine)>0 ){
4558
		if( count($OderOfPartInLine)>0 ){
4539
			
4559
			
4540
			#debug
4560
			#debug
4541
			#var_dump(__LINE__,$OderOfPartInLine);
4561
			#var_dump(__LINE__,$OderOfPartInLine);
4542
			
4562
			
-
 
4563
			#預設一開始 varPart 的計數為 0
-
 
4564
			$varPartCount=0;
-
 
4565
			
4543
			#針對每個資訊
4566
			#針對每個資訊
4544
			foreach($OderOfPartInLine as $index=>$condition){
4567
			foreach($OderOfPartInLine as $index=>$condition){
4545
				
4568
				
4546
				#debug
4569
				#debug
4547
				#var_dump(__LINE__,$index,$condition);
4570
				#var_dump(__LINE__,$index,$condition);
Line 4698... Line 4721...
4698
						break;
4721
						break;
4699
						
4722
						
4700
					#如果是 "varPart"
4723
					#如果是 "varPart"
4701
					case "varPart":
4724
					case "varPart":
4702
					
4725
					
-
 
4726
						#計數第幾個 varPart
-
 
4727
						$varPartCount++;
-
 
4728
					
4703
						#取得變數名稱,亦即去掉開頭的 "${" 跟結尾的 "}"
4729
						#取得變數名稱,亦即去掉開頭的 "${" 跟結尾的 "}"
4704
						$varName=substr($OderOfPartInLine[($index)]["value"],2,strlen($OderOfPartInLine[($index)]["value"])-3);
4730
						$varName=substr($OderOfPartInLine[($index)]["value"],2,strlen($OderOfPartInLine[($index)]["value"])-3);
4705
						
4731
						
4706
						#如果後面沒有 $OderOfPartInLine 了
4732
						#如果後面沒有 $OderOfPartInLine 了
4707
						if(!isset($OderOfPartInLine[($index+1)])){
4733
						if(!isset($OderOfPartInLine[($index+1)])){
4708
						
4734
						
-
 
4735
							#取得變數的數值
-
 
4736
							$varVal=$modifiedInput;
-
 
4737
						
-
 
4738
							/*
-
 
4739
						
4709
							#代表有符合所有條件
4740
							#代表有符合所有條件
4710
							
4741
							
4711
							#設置解析好的變數
4742
							#設置解析好的變數
4712
							$result["content"][]=$modifiedInput;
4743
							$result["content"][]=$modifiedInput;
4713
							
4744
							
Line 4718... Line 4749...
4718
							$result["found"]="true";
4749
							$result["found"]="true";
4719
							
4750
							
4720
							#回傳結果
4751
							#回傳結果
4721
							return $result;
4752
							return $result;
4722
						
4753
						
4723
							}#if end
-
 
4724
							
4754
							*/
4725
						#debug
-
 
4726
						#var_dump(__LINE__,$OderOfPartInLine[($index+1)]);
-
 
4727
							
-
 
4728
						#執行到這邊代表後面還有 $OderOfPartInLine
-
 
4729
						
-
 
4730
						#如果後面的內容不是 keyWordPart
-
 
4731
						if($OderOfPartInLine[($index+1)]["name"]!=="keyWordPart"){
-
 
4732
						
-
 
4733
							#設置錯誤識別
-
 
4734
							$result["status"]="false";
-
 
4735
							
-
 
4736
							#設置錯誤訊息
-
 
4737
							$result["error"][]="multi continued varName not supported";
-
 
4738
							
-
 
4739
							#回傳結果
-
 
4740
							return $result;
-
 
4741
						
4755
						
4742
							}#if end
4756
							}#if end
4743
							
-
 
4744
						#執行到這邊代表為 varPart
-
 
4745
						
-
 
4746
						#函式說明:
-
 
4747
						#取得關鍵字在字串的哪個位置(字首,字尾,中間)
-
 
4748
						#回傳結果:
-
 
4749
						#$result["status"],執行成功與否,若爲"true",代表執行成功,若爲"false"代表執失敗。
-
 
4750
						#$result["error"],錯誤訊息陣列.
-
 
4751
						#$result["function"],當前執行的函數名稱.
-
 
4752
						#$result["found"],是否有關鍵字存在,若為"true",代表存在;反之為"false".
-
 
4753
						#$result["argu"],傳入的參數.
-
 
4754
						#$result["head"],關鍵字是否在字串的開頭,"true"代表是,"false"代表不是.
-
 
4755
						#$result["tail"],關鍵字是否在字串的尾端,"true"代表是,"false"代表不是.
-
 
4756
						#$result["center"],關鍵字是否在字串的中間,"true"代表是,"false"代表不是.
-
 
4757
						#$result["indexS"],關鍵字在被搜尋字串的哪個位置開始.
-
 
4758
						#$result["indexE"],關鍵字在被搜尋字串的哪個位置結束.
-
 
4759
						#必填參數:
-
 
4760
						#$conf["inputStr"],字串,被搜尋的字串.
-
 
4761
						$conf["search::findKeyWordPosition"]["inputStr"]=$modifiedInput;
-
 
4762
						#$conf["keyWord"],字串,關鍵字.
-
 
4763
						$conf["search::findKeyWordPosition"]["keyWord"]=$OderOfPartInLine[($index+1)]["value"];
-
 
4764
						#可省略參數:
-
 
4765
						#無.
-
 
4766
						#參考資料:
-
 
4767
						#http://php.net/manual/en/function.strpos.php
-
 
4768
						#備註:
-
 
4769
						#無.
-
 
4770
						$findKeyWordPosition=search::findKeyWordPosition($conf["search::findKeyWordPosition"]);
-
 
4771
						unset($conf["search::findKeyWordPosition"]);
-
 
4772
					
-
 
4773
						#debug
-
 
4774
						#var_dump(__LINE__,$findKeyWordPosition);
-
 
4775
					
-
 
4776
						#如果執行失敗
-
 
4777
						if($findKeyWordPosition["status"]==="false"){
-
 
4778
						
4757
						
4779
							#設置錯誤識別
-
 
4780
							$result["status"]="false";
-
 
4781
							
-
 
4782
							#設置錯誤訊息
-
 
4783
							$result["error"]=$findKeyWordPosition;
4758
						#執行到這邊代表後面還有 $OderOfPartInLine
4784
							
4759
						else{
4785
							#回傳結果
-
 
4786
							return $result;
-
 
4787
						
4760
						
4788
							}#if end
4761
							#debug
-
 
4762
							#var_dump(__LINE__,$OderOfPartInLine[($index+1)]);
4789
							
4763
							
4790
						#如果沒有符合
4764
							#如果後面的內容不是 keyWordPart
4791
						if($findKeyWordPosition["found"]==="false"){
4765
							if($OderOfPartInLine[($index+1)]["name"]!=="keyWordPart"){
4792
						
-
 
4793
							#設置執行狀態識別
-
 
4794
							$result["status"]="true";
-
 
4795
							
4766
							
-
 
4767
								#設置錯誤識別
-
 
4768
								$result["status"]="false";
-
 
4769
								
-
 
4770
								#設置錯誤訊息
-
 
4771
								$result["error"][]="multi continued varName not supported";
-
 
4772
								
-
 
4773
								#回傳結果
-
 
4774
								return $result;
-
 
4775
							
-
 
4776
								}#if end
-
 
4777
								
-
 
4778
							#執行到這邊代表為 varPart
-
 
4779
							
-
 
4780
							#函式說明:
-
 
4781
							#取得關鍵字在字串的哪個位置(字首,字尾,中間)
-
 
4782
							#回傳結果:
-
 
4783
							#$result["status"],執行成功與否,若爲"true",代表執行成功,若爲"false"代表執失敗。
-
 
4784
							#$result["error"],錯誤訊息陣列.
-
 
4785
							#$result["function"],當前執行的函數名稱.
-
 
4786
							#$result["found"],是否有關鍵字存在,若為"true",代表存在;反之為"false".
-
 
4787
							#$result["argu"],傳入的參數.
-
 
4788
							#$result["head"],關鍵字是否在字串的開頭,"true"代表是,"false"代表不是.
-
 
4789
							#$result["tail"],關鍵字是否在字串的尾端,"true"代表是,"false"代表不是.
-
 
4790
							#$result["center"],關鍵字是否在字串的中間,"true"代表是,"false"代表不是.
-
 
4791
							#$result["indexS"],關鍵字在被搜尋字串的哪個位置開始.
-
 
4792
							#$result["indexE"],關鍵字在被搜尋字串的哪個位置結束.
-
 
4793
							#必填參數:
-
 
4794
							#$conf["inputStr"],字串,被搜尋的字串.
-
 
4795
							$conf["search::findKeyWordPosition"]["inputStr"]=$modifiedInput;
-
 
4796
							#$conf["keyWord"],字串,關鍵字.
-
 
4797
							$conf["search::findKeyWordPosition"]["keyWord"]=$OderOfPartInLine[($index+1)]["value"];
-
 
4798
							#可省略參數:
-
 
4799
							#無.
-
 
4800
							#參考資料:
-
 
4801
							#http://php.net/manual/en/function.strpos.php
-
 
4802
							#備註:
-
 
4803
							#無.
-
 
4804
							$findKeyWordPosition=search::findKeyWordPosition($conf["search::findKeyWordPosition"]);
-
 
4805
							unset($conf["search::findKeyWordPosition"]);
-
 
4806
						
-
 
4807
							#debug
-
 
4808
							#var_dump(__LINE__,$findKeyWordPosition);
-
 
4809
						
-
 
4810
							#如果執行失敗
-
 
4811
							if($findKeyWordPosition["status"]==="false"){
-
 
4812
							
-
 
4813
								#設置錯誤識別
-
 
4814
								$result["status"]="false";
-
 
4815
								
-
 
4816
								#設置錯誤訊息
-
 
4817
								$result["error"]=$findKeyWordPosition;
-
 
4818
								
-
 
4819
								#回傳結果
-
 
4820
								return $result;
-
 
4821
							
-
 
4822
								}#if end
-
 
4823
								
-
 
4824
							#如果沒有符合
-
 
4825
							if($findKeyWordPosition["found"]==="false"){
-
 
4826
							
-
 
4827
								#設置執行狀態識別
-
 
4828
								$result["status"]="true";
-
 
4829
								
-
 
4830
								#設置沒有符合格式
-
 
4831
								$result["found"]="false";
-
 
4832
								
-
 
4833
								#回傳結果
-
 
4834
								return $result;
-
 
4835
							
-
 
4836
								}#if end
-
 
4837
							
-
 
4838
							#執行到這邊代表有符合關鍵字
-
 
4839
							
-
 
4840
							#函式說明:
-
 
4841
							#將字串特定關鍵字與其後面的內容剔除
-
 
4842
							#回傳結果:
-
 
4843
							#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
-
 
4844
							#$result["error"],錯誤訊息陣列.
-
 
4845
							#$result["warning"],警告訊息鎮列.
-
 
4846
							#$result["founded"],有無找到定字串"true"代表有,"false"代表沒有.
-
 
4847
							#$result["function"],當前執行的函數名稱.
-
 
4848
							#$result["oriStr"],要處理的原始字串內容.
-
 
4849
							#$result["content"],處理好的的字串內容.
-
 
4850
							#$result["deleted"],被移除的內容.
-
 
4851
							#$result["argu"],使用的參數.
-
 
4852
							#必填參數:
-
 
4853
							#$conf["stringIn"],字串,要處理的字串.
-
 
4854
							$conf["stringProcess::delStrAfterKeyWord"]["stringIn"]=$modifiedInput;
-
 
4855
							#$conf["keyWord"],字串,特定字串.
-
 
4856
							$conf["stringProcess::delStrAfterKeyWord"]["keyWord"]=$OderOfPartInLine[($index+1)]["value"];
-
 
4857
							#可省略參數:
-
 
4858
							#$conf["deleteLastRepeatedOne"],字串,預設為"false";若為"true"則代表連續遇到同 $conf["keyWord"] 的內容,要將移除內容的起點往後移動到為後一個 $conf["keyWord"].
-
 
4859
							#$conf["deleteLastRepeatedOne"]="";
-
 
4860
							#參考資料:
-
 
4861
							#無.
-
 
4862
							#備註:
-
 
4863
							#無.
-
 
4864
							$delStrAfterKeyWord=stringProcess::delStrAfterKeyWord($conf["stringProcess::delStrAfterKeyWord"]);
-
 
4865
							unset($conf["stringProcess::delStrAfterKeyWord"]);						
-
 
4866
							
-
 
4867
							#如果執行失敗
-
 
4868
							if($delStrAfterKeyWord["status"]==="false"){
-
 
4869
							
-
 
4870
								#設置錯誤識別
-
 
4871
								$result["status"]="false";
-
 
4872
								
-
 
4873
								#設置錯誤訊息
-
 
4874
								$result["error"]=$delStrAfterKeyWord;
-
 
4875
								
-
 
4876
								#回傳結果
-
 
4877
								return $result;
-
 
4878
							
-
 
4879
								}#if end
-
 
4880
								
-
 
4881
							#如果沒有符合
-
 
4882
							if($delStrAfterKeyWord["founded"]==="false"){
-
 
4883
							
-
 
4884
								#設置執行狀態識別
-
 
4885
								$result["status"]="true";
-
 
4886
								
4796
							#設置沒有符合格式
4887
								#設置沒有符合格式
4797
							$result["found"]="false";
4888
								$result["found"]="false";
-
 
4889
								
-
 
4890
								#回傳結果
-
 
4891
								return $result;
-
 
4892
							
-
 
4893
								}#if end
4798
							
4894
							
4799
							#回傳結果
4895
							#另存變數的數值
4800
							return $result;
4896
							$varVal=$delStrAfterKeyWord["content"];
4801
						
-
 
4802
							}#if end
-
 
4803
						
4897
						
4804
						#執行到這邊代表有符合關鍵字
4898
							}#else end
4805
						
4899
						
4806
						#函式說明:
-
 
4807
						#將字串特定關鍵字與其後面的內容剔除
-
 
4808
						#回傳結果:
-
 
4809
						#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
-
 
4810
						#$result["error"],錯誤訊息陣列.
-
 
4811
						#$result["warning"],警告訊息鎮列.
-
 
4812
						#$result["founded"],有無找到定字串"true"代表有,"false"代表沒有.
-
 
4813
						#$result["function"],當前執行的函數名稱.
-
 
4814
						#$result["oriStr"],要處理的原始字串內容.
-
 
4815
						#$result["content"],處理好的的字串內容.
-
 
4816
						#$result["deleted"],被移除的內容.
-
 
4817
						#$result["argu"],使用的參數.
4900
						#如果有設置 $conf["varEqual"]
4818
						#必填參數:
-
 
4819
						#$conf["stringIn"],字串,要處理的字串.
-
 
4820
						$conf["stringProcess::delStrAfterKeyWord"]["stringIn"]=$modifiedInput;
-
 
4821
						#$conf["keyWord"],字串,特定字串.
-
 
4822
						$conf["stringProcess::delStrAfterKeyWord"]["keyWord"]=$OderOfPartInLine[($index+1)]["value"];
-
 
4823
						#可省略參數:
-
 
4824
						#$conf["deleteLastRepeatedOne"],字串,預設為"false";若為"true"則代表連續遇到同 $conf["keyWord"] 的內容,要將移除內容的起點往後移動到為後一個 $conf["keyWord"].
-
 
4825
						#$conf["deleteLastRepeatedOne"]="";
4901
						if(isset($conf["varEqual"])){
4826
						#參考資料:
-
 
4827
						#無.
4902
	
4828
						#備註:
-
 
4829
						#無.
4903
							#debug
4830
						$delStrAfterKeyWord=stringProcess::delStrAfterKeyWord($conf["stringProcess::delStrAfterKeyWord"]);
-
 
4831
						unset($conf["stringProcess::delStrAfterKeyWord"]);						
4904
							#var_dump(__LINE__,$conf["varEqual"]);
4832
						
4905
	
4833
						#如果執行失敗
-
 
4834
						if($delStrAfterKeyWord["status"]==="false"){
-
 
4835
						
4906
							#debug
4836
							#設置錯誤識別
-
 
4837
							$result["status"]="false";
4907
							#var_dump(__LINE__,$varPartCount);
4838
							
4908
	
4839
							#設置錯誤訊息
4909
							#若有設置該變數的條件
4840
							$result["error"]=$delStrAfterKeyWord;
4910
							if(isset($conf["varEqual"][$varPartCount-1])){
4841
							
-
 
4842
							#回傳結果
-
 
4843
							return $result;
-
 
4844
						
-
 
4845
							}#if end
-
 
4846
							
4911
							
4847
						#如果沒有符合
4912
								#取得之
4848
						if($delStrAfterKeyWord["founded"]==="false"){
-
 
4849
						
-
 
4850
							#設置執行狀態識別
-
 
4851
							$result["status"]="true";
4913
								$varEqual=$conf["varEqual"][$varPartCount-1];
4852
							
4914
							
-
 
4915
								#如果條件不為 null,代表變數的數值要等於 $varEqual 才算符合
-
 
4916
								if($varEqual!==null){
-
 
4917
								
-
 
4918
									#如果數值不符合
-
 
4919
									if($varVal!==$varEqual){
-
 
4920
									
-
 
4921
										#設置執行狀態識別
-
 
4922
										$result["status"]="true";
-
 
4923
										
-
 
4924
										#設置沒有符合格式
-
 
4925
										$result["found"]="false";
-
 
4926
										
-
 
4927
										#設置解析好的變數
-
 
4928
										$result["content"][]=$varVal;
-
 
4929
										
-
 
4930
										#用變數名稱來儲存
-
 
4931
										$result["parsedVar"][$varName][]=$varVal;
-
 
4932
					
-
 
4933
										#回傳結果
-
 
4934
										return $result;
-
 
4935
									
-
 
4936
										}#if end
-
 
4937
								
-
 
4938
									}#if end
-
 
4939
								
-
 
4940
								#反之 $varVal 現階段可為任意數值
-
 
4941
								else{
-
 
4942
								
-
 
4943
									#如果有設置額外條件
-
 
4944
									if(isset($conf["varCon"])){
-
 
4945
									
-
 
4946
										#取得其額外條件
-
 
4947
										$varCon=$conf["varCon"][$varPartCount-1];
-
 
4948
									
-
 
4949
										#如果有設置額外條件
-
 
4950
										if($varCon!==null){
-
 
4951
										
-
 
4952
											#檢查額外條件參數
-
 
4953
											#函式說明:
-
 
4954
											#檢查必填與可省略的參數,可省略參數可指定預設要給與什麼數值內容.
-
 
4955
											#回傳結果:
-
 
4956
											#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
-
 
4957
											#$result["error"],執行不正常結束的錯訊息陣列.
-
 
4958
											#$result["simpleError"],簡單表示的錯誤訊息.
-
 
4959
											#$result["function"],當前執行的函式名稱.
-
 
4960
											#$result["argu"],設置給予的參數.
-
 
4961
											#$result["passed"],識別要檢查的全體變數是否存在以及型態是否正確的變數,"true"代表檢查全部通過;"false"代表檢查不通過
-
 
4962
											#$result[$shouldBeCheckedVarName]["varExist"],所檢查的變數是否存在,"false"代表不存在;"true"代表存在
-
 
4963
											#$result[$shouldBeCheckedVarName]["varType"],所檢查的變數型態是否正確,"false"代表錯誤;"true"代表正確
-
 
4964
											#$result[$shouldBeCheckedVarName]["error"],每個參數設定的錯誤訊息
-
 
4965
											#$result["shouldNotBeEmpty"],不應該為空字串或控陣列的變數.
-
 
4966
											#$result["argu"],字串陣列,目前輸入的參數名稱陣列.
-
 
4967
											#$result["legalVarName"],字串陣列,合法可用的參數名稱陣列.
-
 
4968
											#$result["notNeedVar"],字串陣列,多餘的參數名稱.
-
 
4969
											#必填參數:
-
 
4970
											#$conf["varInput"],陣列變數,要檢查的陣列變數,請在要檢查的參數前面加上&,這樣變動的結果才能被套用。
-
 
4971
											$conf["variableCheck::checkArguments"]["varInput"]=&$varCon;
-
 
4972
											#$conf["referenceVarKey"],字串,$conf參數後面的key值,用於移除不要的參考陣列.
-
 
4973
											$conf["variableCheck::checkArguments"]["referenceVarKey"]="variableCheck::checkArguments";
-
 
4974
											#可省略參數:
4853
							#設置沒有符合格式
4975
											#$conf["mustBeFilledVariableName"],爲必填參數的變數名稱陣列,形態爲陣列變數,元素數量需要跟"mustBeFilledVariableType"參數的元素數量一致,例如: $conf["mustBeFilledVariableName"] = array("id","account","password");
-
 
4976
											#$conf["mustBeFilledVariableName"]=array();
4854
							$result["found"]="false";
4977
											#$conf["mustBeFilledVariableType"],爲必填參數的變數陣列應該爲何種變數形態,形態爲陣列,元素數量需要跟"mustBeFilledVariableName"參數的元素數量一致,例如: $conf["mustBeFilledVariableType"] = array("string",integer,"double","resource","object"); , null、any代表不指定變數形態.其中 resource也包含"resource (closed)".
-
 
4978
											#$conf["mustBeFilledVariableType"]=array();
-
 
4979
											#$conf["canBeEmptyString"],字串,必填變數內容如果是空字串就不能算是有設置的話,請設為"false",預設爲"true",可以為空字串.
-
 
4980
											#$conf["canBeEmptyString"]="false";
-
 
4981
											#$conf["canNotBeEmpty"],字串陣列,哪些必填參數的內容不得為空字串或空陣列,僅當$conf["canBeEmptyString"]為"true"時會生效.
-
 
4982
											#$conf["canNotBeEmpty"]=array();
-
 
4983
											#$conf["canBeEmpty"],字串陣列,哪些必填參數的內容可為空字串或空陣列,僅當$conf["canBeEmptyString"]為"false"時會生效.
-
 
4984
											#$conf["canBeEmpty"]=array();
-
 
4985
											#$conf["skipableVariableCanNotBeEmpty"],字串陣列,哪些可省略參數不可以為空字串或空陣列.
-
 
4986
											#$conf["skipableVariableCanNotBeEmpty"]=array();
-
 
4987
											#$conf["skipableVariableName"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableName"] = array("id","account","password");
-
 
4988
											$conf["variableCheck::checkArguments"]["skipableVariableName"]=array("head","no_head","tail","no_tail");
-
 
4989
											#$conf["skipableVariableType"],陣列字串,爲可省略參數的變數名稱陣列,形態爲陣列變數,例如: $conf["skipableVariableType"] = array("string",integer,"double");
-
 
4990
											$conf["variableCheck::checkArguments"]["skipableVariableType"]=array("string","string","string","string");
-
 
4991
											#$conf["skipableVarDefaultValue"],字串陣列,每個不存在的可省略變數要初始化為什麼,null與代表不指定,若預設值是參數之一,請將$conf["mustBeFilledVar"]改成"\$conf["\mustBeFilledVar\"]".
-
 
4992
											#$conf["skipableVarDefaultValue"]=array("");
-
 
4993
											#$conf["disallowAllSkipableVarIsEmpty"],字串,是否允許每個可省略參數都為空字串,預設為"true"允許,反之為"false".
-
 
4994
											#$conf["variableCheck::checkArguments"]["disallowAllSkipableVarIsEmpty"]="";
-
 
4995
											#$conf["disallowAllSkipableVarIsEmptyArray"],字串,是否允許每個可省略參數都為空陣列,預設為"true"允許,反之為"false".
-
 
4996
											#$conf["disallowAllSkipableVarIsEmptyArray"]="";
-
 
4997
											#$conf["disallowAllSkipableVarNotExist"],字串,是否不允許每個可省略參數都不存在,預設為"false"代表允許,反之為"true".
-
 
4998
											$conf["variableCheck::checkArguments"]["disallowAllSkipableVarNotExist"]="true";
-
 
4999
											#$conf["arrayCountEqualCheck"],字串陣列,為檢查哪些陣列參數的元素數量要一樣,$conf["arrayCountEqualCheck"][$i]=array()為第$i組key為哪些的變數其元素數量要相等.
-
 
5000
											#$conf["arrayCountEqualCheck"][]=array();
-
 
5001
											#參考資料:
-
 
5002
											#array_keys=>http://php.net/manual/en/function.array-keys.php
-
 
5003
											#備註:
-
 
5004
											#無.
-
 
5005
											$checkArguments=variableCheck::checkArguments($conf["variableCheck::checkArguments"]);
-
 
5006
											unset($conf["variableCheck::checkArguments"]);
-
 
5007
										
-
 
5008
											#如果執行失敗
-
 
5009
											if($checkArguments["status"]==="false"){
-
 
5010
											
-
 
5011
												#設置錯誤識別
-
 
5012
												$result["status"]="false";
-
 
5013
												
-
 
5014
												#設置錯誤訊息
-
 
5015
												$result["error"]=$checkArguments;
-
 
5016
												
-
 
5017
												#回傳結果
-
 
5018
												return $result;
-
 
5019
											
-
 
5020
												}#if end
-
 
5021
												
-
 
5022
											#如果檢查不通過
-
 
5023
											if($checkArguments["passed"]==="false"){
-
 
5024
											
-
 
5025
												#設置錯誤識別
-
 
5026
												$result["status"]="false";
-
 
5027
												
-
 
5028
												#設置錯誤訊息
-
 
5029
												$result["error"]=$checkArguments;
-
 
5030
												
-
 
5031
												#回傳結果
-
 
5032
												return $result;
-
 
5033
											
-
 
5034
												}#if end
-
 
5035
												
-
 
5036
											#針對每個額外條件
-
 
5037
											foreach($varCon as $con => $cVal){
-
 
5038
											
-
 
5039
												#判斷額外條件
-
 
5040
												switch($con){
-
 
5041
												
-
 
5042
													#如果是 "head"
-
 
5043
													case "head":
-
 
5044
													
-
 
5045
														#函式說明:
-
 
5046
														#取得符合特定字首與字尾的字串
-
 
5047
														#回傳結果:
-
 
5048
														#$result["status"],若爲"true"則代表執行正常;若爲"false"則代表執行失敗。
-
 
5049
														#$result["function"],當前執行的函數名稱.
-
 
5050
														#$result["error"],錯誤訊息陣列.
-
 
5051
														#$result["founded"],若為"true"則代表有找到符合字首條件的結果;若爲"false"則代表沒有找到。
-
 
5052
														#$result["content"],符合條件的字串,去掉字首字尾後的結果.
-
 
5053
														#$result["returnString"],爲符合字首字、尾條件的字串內容。
-
 
5054
														#$result["argu"],使用的參數.
-
 
5055
														#必填參數:
-
 
5056
														#$conf["checkString"],字串,要檢查的字串.
-
 
5057
														$conf["search::getMeetConditionsString"]["checkString"]=$varVal;
-
 
5058
														#可省略參數:
-
 
5059
														#$conf["frontWord"],字串,用來檢查字首應該要有什麼字串,預設不指定.
-
 
5060
														$conf["search::getMeetConditionsString"]["frontWord"]=$cVal;
-
 
5061
														#$conf["tailWord"],字串,用來檢查字尾應該要有什麼字串,預設不指定.
-
 
5062
														#$conf["tailWord"]="";
-
 
5063
														#參考資料:
-
 
5064
														#str_spilt(),可以將字串依照字母分割成一個個陣列字串。
-
 
5065
														#備註:
-
 
5066
														#無.
-
 
5067
														$getMeetConditionsString=search::getMeetConditionsString($conf["search::getMeetConditionsString"]);
-
 
5068
														unset($conf["search::getMeetConditionsString"]);
-
 
5069
													
-
 
5070
														#如果執行失敗
-
 
5071
														if($getMeetConditionsString["status"]==="false"){
-
 
5072
														
-
 
5073
															#設置錯誤識別
-
 
5074
															$result["status"]="false";
-
 
5075
															
-
 
5076
															#設置錯誤訊息
-
 
5077
															$result["error"]=$getMeetConditionsString;
-
 
5078
															
-
 
5079
															#回傳結果
-
 
5080
															return $result;
-
 
5081
														
-
 
5082
															}#if end
-
 
5083
														
-
 
5084
														#如果沒有需要的關鍵字
-
 
5085
														if($getMeetConditionsString["founded"]==="false"){
-
 
5086
														
-
 
5087
															#設置執行正常識別
-
 
5088
															$result["status"]="true";
-
 
5089
															
-
 
5090
															#設置錯誤訊息
-
 
5091
															$result["found"]="false";
-
 
5092
															
-
 
5093
															#設置解析好的變數
-
 
5094
															$result["content"][]=$varVal;
-
 
5095
															
-
 
5096
															#用變數名稱來儲存
-
 
5097
															$result["parsedVar"][$varName][]=$varVal;
-
 
5098
															
-
 
5099
															#回傳結果
-
 
5100
															return $result;
-
 
5101
														
-
 
5102
															}#if end
-
 
5103
														
-
 
5104
														#跳出 switch
-
 
5105
														break;
-
 
5106
														
-
 
5107
													#如果是 "no_head"
-
 
5108
													case "no_head":
-
 
5109
													
-
 
5110
														#函式說明:
-
 
5111
														#取得符合特定字首與字尾的字串
-
 
5112
														#回傳結果:
-
 
5113
														#$result["status"],若爲"true"則代表執行正常;若爲"false"則代表執行失敗。
-
 
5114
														#$result["function"],當前執行的函數名稱.
-
 
5115
														#$result["error"],錯誤訊息陣列.
-
 
5116
														#$result["founded"],若為"true"則代表有找到符合字首條件的結果;若爲"false"則代表沒有找到。
-
 
5117
														#$result["content"],符合條件的字串,去掉字首字尾後的結果.
-
 
5118
														#$result["returnString"],爲符合字首字、尾條件的字串內容。
-
 
5119
														#$result["argu"],使用的參數.
-
 
5120
														#必填參數:
-
 
5121
														#$conf["checkString"],字串,要檢查的字串.
-
 
5122
														$conf["search::getMeetConditionsString"]["checkString"]=$varVal;
-
 
5123
														#可省略參數:
-
 
5124
														#$conf["frontWord"],字串,用來檢查字首應該要有什麼字串,預設不指定.
-
 
5125
														$conf["search::getMeetConditionsString"]["frontWord"]=$cVal;
-
 
5126
														#$conf["tailWord"],字串,用來檢查字尾應該要有什麼字串,預設不指定.
-
 
5127
														#$conf["tailWord"]="";
-
 
5128
														#參考資料:
-
 
5129
														#str_spilt(),可以將字串依照字母分割成一個個陣列字串。
-
 
5130
														#備註:
-
 
5131
														#無.
-
 
5132
														$getMeetConditionsString=search::getMeetConditionsString($conf["search::getMeetConditionsString"]);
-
 
5133
														unset($conf["search::getMeetConditionsString"]);
-
 
5134
													
-
 
5135
														#如果執行失敗
-
 
5136
														if($getMeetConditionsString["status"]==="false"){
-
 
5137
														
-
 
5138
															#設置錯誤識別
-
 
5139
															$result["status"]="false";
-
 
5140
															
-
 
5141
															#設置錯誤訊息
-
 
5142
															$result["error"]=$getMeetConditionsString;
-
 
5143
															
-
 
5144
															#回傳結果
-
 
5145
															return $result;
-
 
5146
														
-
 
5147
															}#if end
-
 
5148
														
-
 
5149
														#如果有不需要的關鍵字
-
 
5150
														if($getMeetConditionsString["founded"]==="true"){
-
 
5151
														
-
 
5152
															#設置執行正常識別
-
 
5153
															$result["status"]="true";
-
 
5154
															
-
 
5155
															#設置錯誤訊息
-
 
5156
															$result["found"]="false";
-
 
5157
															
-
 
5158
															#設置解析好的變數
-
 
5159
															$result["content"][]=$varVal;
-
 
5160
															
-
 
5161
															#用變數名稱來儲存
-
 
5162
															$result["parsedVar"][$varName][]=$varVal;
-
 
5163
															
-
 
5164
															#回傳結果
-
 
5165
															return $result;
-
 
5166
														
-
 
5167
															}#if end
-
 
5168
													
-
 
5169
														#跳出 switch
-
 
5170
														break;
-
 
5171
												
-
 
5172
													#如果是 "tail"
-
 
5173
													case "tail":
-
 
5174
													
-
 
5175
														#函式說明:
-
 
5176
														#取得符合特定字首與字尾的字串
-
 
5177
														#回傳結果:
-
 
5178
														#$result["status"],若爲"true"則代表執行正常;若爲"false"則代表執行失敗。
-
 
5179
														#$result["function"],當前執行的函數名稱.
-
 
5180
														#$result["error"],錯誤訊息陣列.
-
 
5181
														#$result["founded"],若為"true"則代表有找到符合字首條件的結果;若爲"false"則代表沒有找到。
-
 
5182
														#$result["content"],符合條件的字串,去掉字首字尾後的結果.
-
 
5183
														#$result["returnString"],爲符合字首字、尾條件的字串內容。
-
 
5184
														#$result["argu"],使用的參數.
-
 
5185
														#必填參數:
-
 
5186
														#$conf["checkString"],字串,要檢查的字串.
-
 
5187
														$conf["search::getMeetConditionsString"]["checkString"]=$varVal;
-
 
5188
														#可省略參數:
-
 
5189
														#$conf["frontWord"],字串,用來檢查字首應該要有什麼字串,預設不指定.
-
 
5190
														#$conf["search::getMeetConditionsString"]["frontWord"]=$cVal;
-
 
5191
														#$conf["tailWord"],字串,用來檢查字尾應該要有什麼字串,預設不指定.
-
 
5192
														$conf["search::getMeetConditionsString"]["tailWord"]=$cVal;
-
 
5193
														#參考資料:
-
 
5194
														#str_spilt(),可以將字串依照字母分割成一個個陣列字串。
-
 
5195
														#備註:
-
 
5196
														#無.
-
 
5197
														$getMeetConditionsString=search::getMeetConditionsString($conf["search::getMeetConditionsString"]);
-
 
5198
														unset($conf["search::getMeetConditionsString"]);
-
 
5199
													
-
 
5200
														#如果執行失敗
-
 
5201
														if($getMeetConditionsString["status"]==="false"){
-
 
5202
														
-
 
5203
															#設置錯誤識別
-
 
5204
															$result["status"]="false";
-
 
5205
															
-
 
5206
															#設置錯誤訊息
-
 
5207
															$result["error"]=$getMeetConditionsString;
-
 
5208
															
-
 
5209
															#回傳結果
-
 
5210
															return $result;
-
 
5211
														
-
 
5212
															}#if end
-
 
5213
														
-
 
5214
														#如果無需要的關鍵字
-
 
5215
														if($getMeetConditionsString["founded"]==="false"){
-
 
5216
														
-
 
5217
															#設置執行正常識別
-
 
5218
															$result["status"]="true";
-
 
5219
															
-
 
5220
															#設置錯誤訊息
-
 
5221
															$result["found"]="false";
-
 
5222
															
-
 
5223
															#設置解析好的變數
-
 
5224
															$result["content"][]=$varVal;
-
 
5225
															
-
 
5226
															#用變數名稱來儲存
-
 
5227
															$result["parsedVar"][$varName][]=$varVal;
-
 
5228
															
-
 
5229
															#回傳結果
-
 
5230
															return $result;
-
 
5231
														
-
 
5232
															}#if end
-
 
5233
													
-
 
5234
														#跳出 switch
-
 
5235
														break;
-
 
5236
														
-
 
5237
													#如果是 "no_tail"
-
 
5238
													case "no_tail":
-
 
5239
													
-
 
5240
														#函式說明:
-
 
5241
														#取得符合特定字首與字尾的字串
-
 
5242
														#回傳結果:
-
 
5243
														#$result["status"],若爲"true"則代表執行正常;若爲"false"則代表執行失敗。
-
 
5244
														#$result["function"],當前執行的函數名稱.
-
 
5245
														#$result["error"],錯誤訊息陣列.
-
 
5246
														#$result["founded"],若為"true"則代表有找到符合字首條件的結果;若爲"false"則代表沒有找到。
-
 
5247
														#$result["content"],符合條件的字串,去掉字首字尾後的結果.
-
 
5248
														#$result["returnString"],爲符合字首字、尾條件的字串內容。
-
 
5249
														#$result["argu"],使用的參數.
-
 
5250
														#必填參數:
-
 
5251
														#$conf["checkString"],字串,要檢查的字串.
-
 
5252
														$conf["search::getMeetConditionsString"]["checkString"]=$varVal;
-
 
5253
														#可省略參數:
-
 
5254
														#$conf["frontWord"],字串,用來檢查字首應該要有什麼字串,預設不指定.
-
 
5255
														#$conf["search::getMeetConditionsString"]["frontWord"]=$cVal;
-
 
5256
														#$conf["tailWord"],字串,用來檢查字尾應該要有什麼字串,預設不指定.
-
 
5257
														$conf["search::getMeetConditionsString"]["tailWord"]=$cVal;
-
 
5258
														#參考資料:
-
 
5259
														#str_spilt(),可以將字串依照字母分割成一個個陣列字串。
-
 
5260
														#備註:
-
 
5261
														#無.
-
 
5262
														$getMeetConditionsString=search::getMeetConditionsString($conf["search::getMeetConditionsString"]);
-
 
5263
														unset($conf["search::getMeetConditionsString"]);
-
 
5264
													
-
 
5265
														#如果執行失敗
-
 
5266
														if($getMeetConditionsString["status"]==="false"){
-
 
5267
														
-
 
5268
															#設置錯誤識別
-
 
5269
															$result["status"]="false";
-
 
5270
															
-
 
5271
															#設置錯誤訊息
-
 
5272
															$result["error"]=$getMeetConditionsString;
-
 
5273
															
-
 
5274
															#回傳結果
-
 
5275
															return $result;
-
 
5276
														
-
 
5277
															}#if end
-
 
5278
														
-
 
5279
														#如果有無需要的關鍵字
-
 
5280
														if($getMeetConditionsString["founded"]==="true"){
-
 
5281
														
-
 
5282
															#設置執行正常識別
-
 
5283
															$result["status"]="true";
-
 
5284
															
-
 
5285
															#設置錯誤訊息
-
 
5286
															$result["found"]="false";
-
 
5287
															
-
 
5288
															#設置解析好的變數
-
 
5289
															$result["content"][]=$varVal;
-
 
5290
															
-
 
5291
															#用變數名稱來儲存
-
 
5292
															$result["parsedVar"][$varName][]=$varVal;
-
 
5293
															
-
 
5294
															#回傳結果
-
 
5295
															return $result;
-
 
5296
														
-
 
5297
															}#if end
-
 
5298
													
-
 
5299
														#跳出 switch
-
 
5300
														break;
-
 
5301
														
-
 
5302
													#若是其他額外條件
-
 
5303
													default:
-
 
5304
												
-
 
5305
														#設置錯誤識別
-
 
5306
														$result["status"]="false";
-
 
5307
														
-
 
5308
														#設置錯誤訊息
-
 
5309
														$result["error"][]="not supported condition \"".$con."\"";
-
 
5310
														
-
 
5311
														#設置錯誤訊息
-
 
5312
														$result["error"][]=$checkArguments;
-
 
5313
														
-
 
5314
														#回傳結果
-
 
5315
														return $result;
-
 
5316
												
-
 
5317
													}#switch end
-
 
5318
											
-
 
5319
												}#foreach end
-
 
5320
											
-
 
5321
											}#if end
-
 
5322
								
-
 
5323
										}#if end
-
 
5324
								
-
 
5325
									}#else end
4855
							
5326
							
4856
							#回傳結果
-
 
4857
							return $result;
5327
								}#if end
4858
						
5328
						
4859
							}#if end
5329
							}#if end
4860
						
5330
						
4861
						#設置解析好的變數
5331
						#設置解析好的變數
4862
						$result["content"][]=$delStrAfterKeyWord["content"];
5332
						$result["content"][]=$varVal;
4863
						
5333
						
4864
						#用變數名稱來儲存
5334
						#用變數名稱來儲存
4865
						$result["parsedVar"][$varName][]=$delStrAfterKeyWord["content"];
5335
						$result["parsedVar"][$varName][]=$varVal;
4866
						
5336
						
4867
						#函式說明:
-
 
4868
						#將字串特定關鍵字與其前面的內容剔除
-
 
4869
						#回傳結果:
-
 
4870
						#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
-
 
4871
						#$result["error"],錯誤訊息陣列.
-
 
4872
						#$result["warning"],警告訊息鎮列.
-
 
4873
						#$result["founded"],有無找到定字串"true"代表有,"false"代表沒有.
-
 
4874
						#$result["function"],當前執行的函數名稱.
-
 
4875
						#$result["argu"],使用的參數.
-
 
4876
						#$result["oriStr"],要處理的原始字串內容.
-
 
4877
						#$result["content"],處理好的的字串內容.
-
 
4878
						#$result["deleted"],被移除的內容.
-
 
4879
						#必填參數:
-
 
4880
						#$conf["stringIn"],字串,要處理的字串.
-
 
4881
						$conf["stringProcess::delStrBeforeKeyWord"]["stringIn"]=$modifiedInput;
-
 
4882
						#$conf["keyWord"],字串,特定字串.
5337
						#若後面還有特定關鍵字
4883
						$conf["stringProcess::delStrBeforeKeyWord"]["keyWord"]=$OderOfPartInLine[($index+1)]["value"];
5338
						if(isset($OderOfPartInLine[($index+1)]["value"])){
4884
						#可省略參數:
-
 
4885
						#$conf["recursive"],字串,預設為"false"代表找到一個關鍵字就會停止;"true"代表會即重複執行,知道沒有關鍵字為止.
-
 
4886
						#$conf["recursive"]="true";
-
 
4887
						#$conf["lastResult"],陣列,本函式前次執行的結果,若沒有找到關鍵字,則會改回傳該內容.
-
 
4888
						#$conf["lastResult"]=$delStrBeforeKeyWord;
-
 
4889
						#參考資料:
-
 
4890
						#無.
-
 
4891
						#備註:
-
 
4892
						#無.
-
 
4893
						$delStrBeforeKeyWord=stringProcess::delStrBeforeKeyWord($conf["stringProcess::delStrBeforeKeyWord"]);
-
 
4894
						unset($conf["stringProcess::delStrBeforeKeyWord"]);
-
 
4895
						
5339
						
-
 
5340
							#函式說明:
-
 
5341
							#將字串特定關鍵字與其前面的內容剔除
-
 
5342
							#回傳結果:
-
 
5343
							#$result["status"],執行是否正常,"true"代表正常,"false"代表不正常.
-
 
5344
							#$result["error"],錯誤訊息陣列.
-
 
5345
							#$result["warning"],警告訊息鎮列.
-
 
5346
							#$result["founded"],有無找到定字串"true"代表有,"false"代表沒有.
-
 
5347
							#$result["function"],當前執行的函數名稱.
-
 
5348
							#$result["argu"],使用的參數.
-
 
5349
							#$result["oriStr"],要處理的原始字串內容.
-
 
5350
							#$result["content"],處理好的的字串內容.
-
 
5351
							#$result["deleted"],被移除的內容.
-
 
5352
							#必填參數:
-
 
5353
							#$conf["stringIn"],字串,要處理的字串.
-
 
5354
							$conf["stringProcess::delStrBeforeKeyWord"]["stringIn"]=$modifiedInput;
-
 
5355
							#$conf["keyWord"],字串,特定字串.
-
 
5356
							$conf["stringProcess::delStrBeforeKeyWord"]["keyWord"]=$OderOfPartInLine[($index+1)]["value"];
-
 
5357
							#可省略參數:
-
 
5358
							#$conf["recursive"],字串,預設為"false"代表找到一個關鍵字就會停止;"true"代表會即重複執行,知道沒有關鍵字為止.
-
 
5359
							#$conf["recursive"]="true";
-
 
5360
							#$conf["lastResult"],陣列,本函式前次執行的結果,若沒有找到關鍵字,則會改回傳該內容.
-
 
5361
							#$conf["lastResult"]=$delStrBeforeKeyWord;
-
 
5362
							#參考資料:
-
 
5363
							#無.
-
 
5364
							#備註:
-
 
5365
							#無.
-
 
5366
							$delStrBeforeKeyWord=stringProcess::delStrBeforeKeyWord($conf["stringProcess::delStrBeforeKeyWord"]);
-
 
5367
							unset($conf["stringProcess::delStrBeforeKeyWord"]);
-
 
5368
							
4896
						#debug
5369
							#debug
4897
						#var_dump(__LINE__,$delStrBeforeKeyWord);
5370
							#var_dump(__LINE__,$delStrBeforeKeyWord);
4898
						
5371
							
4899
						#如果執行失敗
5372
							#如果執行失敗
4900
						if($delStrBeforeKeyWord["status"]==="false"){
5373
							if($delStrBeforeKeyWord["status"]==="false"){
4901
						
5374
							
4902
							#設置錯誤識別
5375
								#設置錯誤識別
4903
							$result["status"]="false";
5376
								$result["status"]="false";
-
 
5377
								
-
 
5378
								#設置錯誤訊息
-
 
5379
								$result["error"]=$delStrBeforeKeyWord;
-
 
5380
								
-
 
5381
								#回傳結果
-
 
5382
								return $result;
-
 
5383
							
-
 
5384
								}#if end
-
 
5385
								
-
 
5386
							#如果該存在的關鍵字不在
-
 
5387
							if($delStrBeforeKeyWord["founded"]==="false"){
-
 
5388
							
-
 
5389
								#設置錯誤識別
-
 
5390
								$result["status"]="true";
-
 
5391
								
-
 
5392
								#設置沒有符合格式
-
 
5393
								$result["found"]="false";
-
 
5394
								
-
 
5395
								#回傳結果
-
 
5396
								return $result;
-
 
5397
								
-
 
5398
								}#if end
4904
							
5399
							
4905
							#設置錯誤訊息
5400
							#取得剩下未判斷是否符合的項目
4906
							$result["error"]=$delStrBeforeKeyWord;
5401
							$modifiedInput=$OderOfPartInLine[($index+1)]["value"].$delStrBeforeKeyWord["content"];
4907
							
5402
							
4908
							#回傳結果
5403
							#debug
4909
							return $result;
5404
							#var_dump(__LINE__,$modifiedOriLineContent);
4910
						
5405
						
4911
							}#if end
5406
							}#if end
4912
							
-
 
4913
						#如果該存在的關鍵字不在
-
 
4914
						if($delStrBeforeKeyWord["founded"]==="false"){
-
 
4915
						
-
 
4916
							#設置錯誤識別
-
 
4917
							$result["status"]="true";
-
 
4918
							
-
 
4919
							#設置沒有符合格式
-
 
4920
							$result["found"]="false";
-
 
4921
							
-
 
4922
							#回傳結果
-
 
4923
							return $result;
-
 
4924
							
-
 
4925
							}#if end
-
 
4926
						
-
 
4927
						#取得剩下未判斷是否符合的項目
-
 
4928
						$modifiedInput=$OderOfPartInLine[($index+1)]["value"].$delStrBeforeKeyWord["content"];
-
 
4929
						
-
 
4930
						#debug
-
 
4931
						#var_dump(__LINE__,$modifiedOriLineContent);
-
 
4932
						
5407
						
4933
						#換找下個資訊有無符合
5408
						#換找下個資訊有無符合
4934
						continue 2;
5409
						continue 2;
4935
					
5410
					
4936
						break;
5411
						break;
Line 4994... Line 5469...
4994
	#$result["found"],是否有找到符合格式的字串內容,"true"代表有找到,"false"代表沒有找到.
5469
	#$result["found"],是否有找到符合格式的字串內容,"true"代表有找到,"false"代表沒有找到.
4995
	#$result["content"],陣列,若為n個${*},則當found為"true"時,就會回傳n個元素.
5470
	#$result["content"],陣列,若為n個${*},則當found為"true"時,就會回傳n個元素.
4996
	#必填參數:
5471
	#必填參數:
4997
	#$conf["input"],字串,要檢查的字串.
5472
	#$conf["input"],字串,要檢查的字串.
4998
	$conf["input"]="";
5473
	$conf["input"]="";
4999
	#$conf["format"],格式字串陣列,要尋找的可能格式字串集合.格式為固定的字串("fixedStr format")與變數(${keyWordVarName})組成.
5474
	#$conf["format"],格式字串陣列,要尋找的可能格式字串集合.格式為固定的字串("fixedStr format")與變數("${keyWordVarName}")組成.
5000
	$conf["formats"]=array("");
5475
	$conf["formats"]=array("");
5001
	#可省略參數:
5476
	#可省略參數:
5002
	#無.
5477
	#無.
5003
	#參考資料:
5478
	#參考資料:
5004
	#無.
5479
	#無.
Line 5215... Line 5690...
5215
	#$result["found"],是否有找到符合格式的字串內容,"true"代表有找到,"false"代表沒有找到.
5690
	#$result["found"],是否有找到符合格式的字串內容,"true"代表有找到,"false"代表沒有找到.
5216
	#$result["content"],陣列,key為lineNo者為inputs參數的索引;key為content者為符合的資訊,若為n個${*},則當found為"true"時,就會回傳n個元素.
5691
	#$result["content"],陣列,key為lineNo者為inputs參數的索引;key為content者為符合的資訊,若為n個${*},則當found為"true"時,就會回傳n個元素.
5217
	#必填參數:
5692
	#必填參數:
5218
	#$conf["inputs"],字串陣列,要檢查的字串集合.
5693
	#$conf["inputs"],字串陣列,要檢查的字串集合.
5219
	$conf["inputs"]=array("");
5694
	$conf["inputs"]=array("");
5220
	#$conf["format"],格式字串陣列,要尋找的可能格式字串集合.格式為固定的字串("fixedStr format")與變數(${keyWordVarName})組成.
5695
	#$conf["format"],格式字串陣列,要尋找的可能格式字串集合.格式為固定的字串("fixedStr format")與變數("${keyWordVarName}")組成.
5221
	$conf["formats"]=array("");
5696
	$conf["formats"]=array("");
5222
	#可省略參數:
5697
	#可省略參數:
5223
	#無.
5698
	#無.
5224
	#參考資料:
5699
	#參考資料:
5225
	#無.
5700
	#無.
Line 5469... Line 5944...
5469
			$result["error"]="函數".$result["function"]."需要參數";
5944
			$result["error"]="函數".$result["function"]."需要參數";
5470
			
5945
			
5471
			#回傳結果
5946
			#回傳結果
5472
			return $result;
5947
			return $result;
5473
			
5948
			
5474
			}#if end		
5949
			}#if end
5475
 
5950
 
5476
		#取得參數
5951
		#取得參數
5477
		$result["argu"]=$conf;
5952
		$result["argu"]=$conf;
5478
 
5953
 
5479
		#如果 $conf 不為陣列
5954
		#如果 $conf 不為陣列