![]() |
Any php gurus here? Array_walk help needed
Im trying to create a file by using each element of an array as the filename. I have the following code and am getting an Invalid argument error.
$newfile = file("newdata.txt"); function touchfile($foo) { touch($foo); } array_map ("touchfile", $newfile); The error is occurring in the touch line. Any suggestions are appreciated. Chris |
HAve you checled what newdata.txt contains?
|
edit....
|
sure your permissions are alright?
|
Quote:
ex. foo.html foo1.html |
Quote:
touch($foo); to touch('$foo'); it will create the file $foo |
This works:
Code:
<?php |
what's the error you are getting?
|
Thanks swedguy. I guess there was a space/carriage return that was causing an error.
|
Hmm, just adding double quotes on the trim() in the original code works too. Odd.
|
| All times are GMT -7. The time now is 10:11 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123