Hey,
I'm relatively new to PHP. I have programmed in C++ and JavaScript before.
I have this piece of code that writes a value to a file.
[PHP]$myFile = "minval.php ";
$fh = fopen($myFile, 'w') or die("can't open file");;
fwrite($fh, $minval);
fclose($fh);[/PHP]
The $minval is user defined and is an integer.
Anyways, after I try to include the "minval.php " like this:
[PHP]$order = include('minval .php');[/PHP]
The minimum value is always 1 (because include() returns 1). I want it to return the value inside of minval.php, not 1.
Anyone know how to do it?
I'm relatively new to PHP. I have programmed in C++ and JavaScript before.
I have this piece of code that writes a value to a file.
[PHP]$myFile = "minval.php ";
$fh = fopen($myFile, 'w') or die("can't open file");;
fwrite($fh, $minval);
fclose($fh);[/PHP]
The $minval is user defined and is an integer.
Anyways, after I try to include the "minval.php " like this:
[PHP]$order = include('minval .php');[/PHP]
The minimum value is always 1 (because include() returns 1). I want it to return the value inside of minval.php, not 1.
Anyone know how to do it?
Comment