Reputation: 27
$dataOrder = [
'orderid' => date( 'ymdhis' )
];
$details =[
'orderid'=>$dataOrder->orderid
];
I need to pass $dataOrder array's orderid value into $details array. And error is "Attempt to read property "orderid" on array". This code is for testing purpose.
Upvotes: 0
Views: 87
Reputation:
change $dataOrder->orderid
to $dataOrder['orderid']
by the way, you can do this:
$dataOrder = date( 'ymdhis' );
$details = [
'orderid'=>$dataOrder
];
Upvotes: 1