Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Sep 2006
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Reading Contents

    Read Content
    PHP Code:
    <?php
    if($content file-get-contents('verses.txt')) {
      
    $content str-replace('--NEXT--'''$content);
      echo 
    $content;

    ?>
    verses.txt
    Code:
    <span class="verses shift">
    <strong>Quote:</strong>
    What you do, may stun you but not God. With perfect knowledge of your imperfect life, God signed on. - Max Lucado</span>
    
    --NEXT--
    
    <span class="verses shift">
    <strong>Quote:</strong>
    A little rain can straighten a flowers stem.. A little love can change a life. - Max Lucado</span>
    
    --NEXT--
    
    etc..
    Fatal error: Call to undefined function contents() in D:\Lostseed\helping-hand\bible-verses.php on line 36

  • #2
    New Coder
    Join Date
    Sep 2006
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts
    oops. ha, silly me I fixed it and got to used to naming files with a dash :P

    file-get-contents = file_get_contents
    str-replace = str_replace

    What a dumb mistake :P

  • #3
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,046
    Thanks
    19
    Thanked 42 Times in 42 Posts
    for reference on a function visit http://www.php.net/function.functionname.php
    like
    http://www.php.net/function.file-get-contents.php
    in the url you can replace _ with - and get the same results


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •