$calback_total = @$this->model_catalog_callback->getTotalOrder();
$array = array('Alpha', 'Beta', 'Gamma', 'Sigma');
function depth_picker($arr, $temp_string, &$collect, $len=0) {
$max = 3;
if ($len > $max) {
return;
}
if ($temp_string != "")
$collect []= $temp_string;
for ($i=0; $i<sizeof($arr);$i++) {
$arrcopy = $arr;
$elem = array_splice($arrcopy, $i, 1); // removes and returns the i'th element
if (sizeof($arrcopy) > 0) {
depth_picker($arrcopy, $temp_string ." " . $elem[0], $collect, $len+1);
} elseif ($len < $max) {
$collect []= $temp_string. " " . $elem[0];
}
}
}
$collect = array();
depth_picker($array, "", $collect);
print_r($collect);
$s = 'HTTP/1.1 200 OK Server: nginx Date: Fri, 24 Jun 2016 00:12:40 GMT Content-Type: application/json;charset=UTF-8 Content-Length: 181 Connection: keep-alive Keep-Alive: timeout=120 Vary: Accept-Encoding Cache-Control: no-cache {"account":"789797078","balance":0.00,"currency":"643","identified":false,"account_type":"personal","account_status":"named","balance_details":{"total":0.00,"available":0.00}}';
preg_match('/^HTTP\/\d+\.\d+\s+(\d+)/', $s, $r);
$code = $r[1];
preg_match('/"balance":([\d\.]+)/', $s, $r);
$balance = $r[1];
echo($code.' '.$balance);