PHP Functions?

  chris57828 17:09 04 Apr 2011
Locked

Hi, I am new to programming, looking at the PHP code below can someone tell me why function pcust() does not work, thanks, Chris.

?php
$firstname = "chris";
$surname = "reynolds";
$address1 = "12 birch end";
$town = "Wallington";
$county = "surrey";
$postcode = "wh20 3bg";
$telephone = "01372 854785";
$cust_details = fix_cust($firstname, $surname, $address1,$town, $county, $postcode, $telephone );
function fix_cust($n1, $n2, $n3, $n4, $n5, $n6, $n7)
{
$n1 = ucfirst(strtolower($n1));
$n2 = ucfirst(strtolower($n2));
$n3 = ucwords(strtolower($n3));
$n4 = ucfirst(strtolower($n4));
$n5 = ucfirst(strtolower($n5));
$n6 = ucfirst(strtoupper($n6));
$n7 = ucfirst(strtolower($n7));
return array($n1, $n2, $n3, $n4, $n5, $n6, $n7);
}
echo $cust_details[0] . " " . $cust_details[1];
echo " br />";
echo $cust_details[2];
echo " br />";
echo $cust_details[3];
echo " br />";
echo $cust_details[4];
echo " br />";
echo $cust_details[5];
echo " br />";
echo $cust_details[6];
echo " br />";

function pcust()
{
$length = count($cust_details );
for ($i = 0; $i $length; $i++) {
echo $cust_details[$i];
echo " br />";
}
}
pcust();
?>

  Nontek 17:32 04 Apr 2011

I don't know the first thing about programming, but I would never put my name/address/telephone number on display in an open World-wide computer site.

  chris57828 17:40 04 Apr 2011

To Nontek, it's not my real name and address!

  Nontek 19:01 04 Apr 2011

Great - glad to hear that, I did wonder!

Anyway, good luck with your programming, way beyond my feeble capabilities.

  chris57828 08:26 05 Apr 2011

LOL! At the moment programming appears to be beyond my meager capabilities!

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

The Evil Within 2 review-in-progress

InVision Studio takes on Adobe XD and Sketch

iPhone X news: Release date, price, new features & specs

Comment transformer un iPhone en borne Wi-Fi ?