Re: Function not returning
- From: "Mike" <mike@xxxxxxxxxxxxxxxxxxxxx>
- Date: 17 Jul 2006 01:39:40 -0700
Thanks, that all works now.
Can you explain though why it wasn't returning $reply?
Mike
Janwillem Borleffs wrote:
Mike schreef:
//functions.php>
<?php
function test($mike) {
if ($mike = "hello"){
This is an assignment; it should read:
if ($mike == "hello"){ ...
Tip: Set the fixed value before the variable to prevent mistakes like
these in the future:
if ("hello" == $mike){ ...
//test.php
<?php
include("functions.php");
$mike = "hello";
test($mike);
echo $reply;
The test function returns a value, so the proper coding would be:
$reply = test($mike);
echo $reply;
JW
.
- Follow-Ups:
- Re: Function not returning
- From: Janwillem Borleffs
- Re: Function not returning
- References:
- Function not returning
- From: Mike
- Re: Function not returning
- From: Janwillem Borleffs
- Function not returning
- Prev by Date: Re: Function not returning
- Next by Date: Re: Function not returning
- Previous by thread: Re: Function not returning
- Next by thread: Re: Function not returning
- Index(es):
Relevant Pages
|