Update string.utl.php

This commit is contained in:
Namhyeon Go 2018-10-28 17:57:31 +09:00 committed by GitHub
parent 0b94c38d13
commit 3aab145df4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -131,3 +131,22 @@ if(!function_exists("multiexplode")) {
return $launch;
}
}
if(!function_exists("parse_pipelined_data")) {
function parse_pipelined_data($pipelined_data, $keynames=array()) {
$result = array();
$parsed_data = explode("|", $pipelined_data);
if(count($keynames) > 0) {
$i = 0;
foreach($keynames as $name) {
$result[$name] = $parsed_data[$i];
$i++;
}
} else {
$result = $parsed_data;
}
return $result;
}
}