<?php
// Dump the games.csv file into an array
$games = fgets('file/games.csv');
// Parse the array
foreach($games as $game)
{
echo "{$game}";
}
?>
Error i get
Warning: fgets() expects parameter 1 to be resource, string given in C:\wamp\www\test\peartest.php on line 3
Call Stack
# Time Memory Function Location
1 0.0004 671880 {main}( ) ..\peartest.php:0
2 0.0004 672008 fgets ( ) ..\peartest.php:3
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\test\peartest.php on line 5
Call Stack
# Time Memory Function Location
1 0.0004 671880 {main}( ) ..\peartest.php:0
------------------------------
Any solution to it ?????
kakalahori 0 Junior Poster in Training
pritaeas 2,194 ¯\_(ツ)_/¯ Moderator Featured Poster
cmps 26 Light Poster
diafol
kakalahori 0 Junior Poster in Training
kakalahori 0 Junior Poster in Training
kakalahori 0 Junior Poster in Training
kakalahori 0 Junior Poster in Training
cmps 26 Light Poster
diafol
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.