Jump to content

Search the Community

Showing results for tags 'file_put_contents'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 3 results

  1. Hi When I have a file that echoes some stuff and I press view source and copy paste the source and manually makes this to a .txt file Something different happening somewhere comapred to if I have ob_start() //before the content ob_get_contents and file_put_contents //after to make the text file. I' do get a text file. It looks the same. the content is the same as my manually made. But when I load it with ajax in to my div only the manually made is scrollable. the scroll is made with .js What is going on here?
  2. Hello I have problem to get the whole loop saved in to a file. I seams to save only the last "section" So I have two json files that I decode and managed to echo as I wanted. Now plans changed and I want to save what was echoed in to a file instead. I planned to use file_put_contents for that. My code looks like this but it did not put the whole list in to the file. just one. (I show you only the foreach and attempted file saving. <code> foreach ( $venues as $item){ $s1 = '<li style="padding-top:15px;">' . '<a target="_blank" href="http://foursquare.com/v/' . $item['id'] . '">' . $item['name'] . '</a></li>'; $endpoint2 = 'venues/' . $item['id'] . '/tips'; $params2 = '?limit=1'; $url2 = $base_url.$endpoint2.$params2.$auth; $results2 = file_get_contents($url2); $json_results2 = json_decode($results2,true); $venues2 = $json_results2['response']['tips']['items']; foreach ( $venues2 as $ti){ $s2 = '<li>' . '<span>' . date('j.n.Y',$ti['createdAt']) . '</span>' . ' - ' . $ti['text'] . '</li>'; } } file_put_contents('output.txt',$s1 . $s2); //echo $s1 . $s2; //for quick check </code> If I remove the $s1 and respectively $s2 and put the echo instead I get the whole result on my screen. So why is this only taking the last <li><a href="url and result and so on in to the file? This forum did not allow me to format my text, so appologises for that.
  3. 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 ...
×
×
  • 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.