- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
function Parsing($raw)
{
$RawProperty=array();
$Property=array();
$raw=str_ireplace("\n","",$raw);
$raw=str_replace("\r","<br/>",$raw);
preg_match_all("|<Policy>(.*)</Policy>|U",$raw,$RawProperty,PREG_OFFSET_CAPTURE);
//print_r($RawProperty);
for ($k=0;$k<count($RawProperty[0]);$k++){
$Property[$k]['Insurer']=str_cut_btw_substrs("<InsurerLogoURL>","</InsurerLogoURL>",$RawProperty[0][$k][0]);
$Property[$k]['InsurerName']=str_cut_btw_substrs("<InsurerName>","</InsurerName>",$RawProperty[0][$k][0]);
$Property[$k]['Underwriter']=str_cut_btw_substrs("<UnderwriterName>","</UnderwriterName>",$RawProperty[0][$k][0]);
$Property[$k]['LinkURL']=str_cut_btw_substrs("<LinkURL>","</LinkURL>",$RawProperty[0][$k][0]);
$Property[$k]['Productname']=str_cut_btw_substrs("<ProductName>","</ProductName>",$RawProperty[0][$k][0]);
$Property[$k]['PremiumText']=str_cut_btw_substrs("<PremiumText>","</PremiumText>",$RawProperty[0][$k][0]);
$Property[$k]['PremiumEXText']=str_cut_btw_substrs("<PremiumEXText>","</PremiumEXText>",$RawProperty[0][$k][0]);
$Property[$k]['ExcessText']=str_cut_btw_substrs("<ExcessText>","</ExcessText>",$RawProperty[0][$k][0]);
$Property[$k]['LuggageText']=str_cut_btw_substrs("<LuggageText>","</LuggageText>",$RawProperty[0][$k][0]);
$Property[$k]['MedicalText']=str_cut_btw_substrs("<MedicalText>","</MedicalText>",$RawProperty[0][$k][0]);
$Property[$k]['CancelationText']=str_cut_btw_substrs("<CancelationText>","</CancelationText>",$RawProperty[0][$k][0]);
$Property[$k]['LiabilityText']=str_cut_btw_substrs("<LiabilityText>","</LiabilityText>",$RawProperty[0][$k][0]);
$Property[$k]['AdditionalFeatures']=str_cut_btw_substrs("<AdditionalFeatures>","</AdditionalFeatures>",$RawProperty[0][$k][0]);
//add fields "ExplanationText" and "IsShaded"
$Property[$k]['IsShaded']=str_cut_btw_substrs("<IsShaded>","</IsShaded>",$RawProperty[0][$k][0]);
$Property[$k]['ExplanationText']=str_cut_btw_substrs("<ExplanationText>","</ExplanationText>",$RawProperty[0][$k][0]);
$Property[$k]['IsBasicCover']=str_cut_btw_substrs("<IsBasicCover>","</IsBasicCover>",$RawProperty[0][$k][0]);
$Property[$k]['IsComprCover']=str_cut_btw_substrs("<IsComprCover>","</IsComprCover>",$RawProperty[0][$k][0]);
}
return $Property;
}