0
   $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.

1 Answer 1

1

change $dataOrder->orderid to $dataOrder['orderid']

by the way, you can do this:

$dataOrder = date( 'ymdhis' );

$details = [
      'orderid'=>$dataOrder
 ];
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.