Here is a bit of code I whipped up using explode
(DEMO)
<?php
$str = "Source: Web | Pics: 1 | Frame: 2 | Date: 4-25-2011 | On: App | Lat: 51.2222 | Lon: 7.6555";
$arr = explode(" | ", $str);
foreach ($arr as $item){
$arr2 = explode(": ", $item);
$finalArray[$arr2[0]]=$arr2[1];
}
print_r($finalArray);
?>
RESULT
Array
(
[Source] => Web
[Pics] => 1
[Frame] => 2
[Date] => 4-25-2011
[On] => App
[Lat] => 51.2222
[Lon] => 7.6555
)
USAGE
echo $finalArray['Lon']; //yields '7.6555'
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…