with associative arrays. Here's the code:
//this is inside a function
$id = '12345';
return array(
'status' => 'success'
'data' => $id
);
The value of 'data' in the result is always empty, however, if I prepend the value with an empty string, it works.
//this is inside a function
$id = '12345';
return array(
'status' => 'success'
'data' => '' . $id
);
Is this a normal behaviour?
Empty or null?
try value of data is $user_id. e.g return ['status' => 'success', 'data' => $user_id];
Обсуждают сегодня