Jump to content

array error scalar value.


ok

Recommended Posts

what is wrong with this codes?

 

<?php
//Testing multi-dimentional array
echo "<h3>Multi-Dimentional Array test.</h3>";
echo "<br>";

for($i=0; $i<=10; $i++) {
	$names[]=$i;
}

echo "<br>";
echo "<b>Single array</b>";
echo "<br>";	

echo "<b>print_r</b>";
echo "<pre>";
print_r($names);
echo "</pre>";

echo "<br>";
echo "<b>Multi array</b>";
echo "<br>";	

for($i=0; $i<=10; $i++) {
	$names[$i][$i]=$i;
}

echo "<b>print_r</b>";
echo "<pre>";
print_r($names);
echo "</pre>";

?>

 

Thank you in advance

Link to comment
https://forums.phpfreaks.com/topic/135266-array-error-scalar-value/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.