I need help on writing a function \"validate\" that accepts 1 parameter. The one
ID: 3539268 • Letter: I
Question
I need help on writing a function "validate" that accepts 1 parameter. The one parameter is the value of a customerID. validate() must call customerLookup() and return what customerLookup() returns.
I need to "call" customerLookup and pass the parameter to it and reutrn what customerLookup returns.
Here is what I have so far as a test function, but it just returns "2" and "Not Found."
Im really confused on how to pass the function to customerLookup and return what it returns. Any Help please?
<?php
function customerLookup() {
if ($customerId = 1) {
return "alex";
} else {
echo "NOT FOUND!";
};
};
function validate ($p1) {
customerLookup($p1);
$customerID = $p1;
return $customerID;
echo $customerID;
};
echo validate(2);
?>
Explanation / Answer
No answer text found in this record.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.