0

This simple test below generates weird sequence

<?php $cellphones = array( 'iphone5' => 500, 'iphone6' => 700, 'iphone7' => 900 ); echo 'All cellphones : ' . print_r($cellphones); ?> 

The result I'm expecting to see is : All cellphone :

Array ( [iphone5] => 500 [iphone6] => 700 [iphone7] => 900 ) 

but instead I got this :

Array ( [iphone5] => 500 [iphone6] => 700 [iphone7] => 900 ) All cellphone : 1 

The sequence of the echo has some problem? and I notice after the sentence of "All cellphone" there a value of 1 at the end.

Thanks

2
  • echo 'All cellphones : ' . print_r($cellphones, true); Commented Mar 6, 2017 at 8:34
  • Wow, this is the BEST solution. Thank you bro! Commented Mar 6, 2017 at 9:46

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.