[SOLVED] Foreach statement
Posted: Thu Aug 02, 2007 12:42 am
Code: Select all
<?php
$column_names = array("user_name" => "abcd","password" => "abc123#","email_id" => "abcd@yahoo.com","location" => "india");
$count = count($column_names);
echo $count."<br>";
foreach($column_names as $key => $value)
{
echo "<br>"."$key => $value\n"."<br>";
}
?>i.e,
Code: Select all
$str_1 = "user_name, password, email_id, location";
and
$str_2 = " abcd, abc123#, abcd@yahoo.com, india";Thanks and Regards,
dream2rule