2019-05-25 17:02:45 +00:00
|
|
|
<?php
|
2019-05-25 17:16:24 +00:00
|
|
|
/**
|
|
|
|
* @file rsf.format.php
|
|
|
|
* @date 2019-05-28
|
|
|
|
* @author Go Namhyeon <gnh1201@gmail.com>
|
|
|
|
* @brief the another data format for ReasonableFramework
|
|
|
|
*/
|
2019-05-25 17:02:45 +00:00
|
|
|
|
|
|
|
if(!check_function_exists("get_rsf_encoded")) {
|
|
|
|
function get_rsf_encoded($data) {
|
2019-05-25 17:04:29 +00:00
|
|
|
$_ks = array();
|
|
|
|
$_vs = array();
|
|
|
|
foreach($data as $k=>$v) {
|
|
|
|
$_ks[] = $k;
|
|
|
|
$_vs[] = make_safe_argument($v);
|
|
|
|
}
|
2019-05-25 17:20:29 +00:00
|
|
|
return sprintf("('%s')=>(%s)", implode("','", $_vs), implode(",", $_ks));
|
2019-05-25 17:02:45 +00:00
|
|
|
}
|
|
|
|
}
|