fwrite variable to new file

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
MedianInf
Forum Newbie
Posts: 1
Joined: Mon Jan 21, 2008 1:46 pm

fwrite variable to new file

Post by MedianInf »

I'm trying to use fwrite to create a new file with the variable "custom_list" but its just creating a blank file - the variable "custom_list" doesn't show up. Here's my code:

<?php

$file = fopen("list_test.php","w+");

echo fwrite($file, $custom_list);
//some code to be executed

fclose($file);
?>
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Re: fwrite variable to new file

Post by Oren »

echo fwrite($file, $custom_list); :? :? :?
Post Reply