Jump to content

Why hasn't file_put_contents created a txt file in my working directory?


the5thace

Recommended Posts

I'm just trying to load some of the echoed results in to a txt file that I can use myself. I assumed that there should be a txt file in my server directory but no file has been created. What am I doing wrong? 

while ($blekr<=$blekko_count)
    {
        echo '<a href='.$Blekko[$blekr]['url'].'><h4>'.$Blekko[$blekr]['url_title'].'</h4></a>';
        echo '<p>'.$Blekko[$blekr]['snippet'].'<p>';
        echo '<b>'.$Blekko[$blekr]['engine'].'</b>';
        $file = 'Blekko.txt';
        file_put_contents($file, $Blekko[$blekr]['url'], FILE_APPEND);
        echo '<hr>';
        $blekr++;
    }

The echo statements run fine but no file anywhere to be found. There isn't anything said in the manual either ...

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.