FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Taking parameters into functions
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Taking parameters into functions [message #175657] Sun, 16 October 2011 12:56 Go to previous message
houghi is currently offline  houghi
Messages: 45
Registered: September 2011
Karma:
Member
I have the following code:

$File = "test.txt";
function write_fifo($data,$File) {
echo $data."<br>".$File."<hr>";
$fh = fopen($File, 'w') or exit("can't open file -".$File."= .");
fwrite($fh, $data);
fclose($fh);
}
write_fifo("Something Here",$File);

This works. What I want to ask is about the write_fifo() part. Is it
possible to have something like the following:
write_fifo("Something Here");
instead of the line including $File.

Not a real must. Just a nice to have. It would make my code perhaps a
bit cleaner AND I would have learned something that I could use in the
future.

I have looked, but could not find anything. Probably because I have no
idea what I should be looking for (php novice and all that)

houghi
--
This is written under the inluence of the following:
> Artist : Evanescence
> Song : Exodus
> Album : EP
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Stats comp.lang.php (last 7 days)
Next Topic: Editing a combobox
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 16:16:03 GMT 2024

Total time taken to generate the page: 0.03811 seconds