Page 1 of 1

Variables in fwrite function

Posted: Mon Mar 02, 2009 7:09 am
by becky-atlanta
$i['qty'] is a variable that I want to write to a file. The following line gives me an error or unexpected ".".

fwrite($fx, .$i['qty'].);

What is the correct syntax for this?

Re: Variables in fwrite function

Posted: Mon Mar 02, 2009 7:21 am
by Mark Baker
The correct syntax is without the dots that the error tells you you shouldn't have

Code: Select all

fwrite($fx,  $i['qty']);

Re: Variables in fwrite function

Posted: Mon Mar 02, 2009 7:43 am
by becky-atlanta
Thanks, Mark! That works. :D