How to save each value of the above array in a variable using PHP.
Array ( [0] => Abbottabad )
Array ( [0] => Faisalabad )
Array ( [0] => Gujranwala )
Array ( [0] => Hyderabad )
Array ( [0] => Islamabad )
Array ( [0] => Karachi )
Array ( [0] => Lahore )
Array ( [0] => Mangla )
Array ( [0] => Multan )
Array ( [0] => Muree )
Array ( [0] => Peshawar )
Array ( [0] => Quetta )
Array ( [0] => Rawalpindi )
Array ( [0] => Sialkot )
I have got these values form mysql. Now I want to store in to a variable in such a way that I cant print each value separately.
Save these array into an array (I hope you are talking about array of objects that is returned by database), if not just save it in array to avoid static checks.
foreach($arrayResult as $key => $value){
foreach($value as $dataArray){
echo $dataArray;
}
}