hi guys,
its my second week learning php and i am very new to it.
wrote a code to see if i can retrieve a value in an array using readline(""), but the code wont work properly. i know there is something am doing wrong but i am just wondering if someone can put me on the right track. please see below code:
<?php
$contact = array ("sam"=>"davies","james"=>"wade");
foreach($contact as $contacts=>$surname)
{
while(true)
{
$first_name = readline("ENTER FIRST NAME:");
if ($first_name == $contacts)
{
echo $contacts. " " .$surname."\n";
continue;
}
}
}
?>
will appreciate any feedback.