Answers for "php equivalent Object.keys"

PHP
0

php implode as key value of object

$output = implode(', ', array_map(
    function ($v, $k) { return sprintf("%s='%s'", $k, $v); },
    $input,
    array_keys($input)
));
Posted by: Guest on September-13-2020
0

php use variable as object key

$nid_property = 'my_nid';
$nid = $row->{$nid_property};
Posted by: Guest on December-04-2020

Browse Popular Code Answers by Language