PHP Undefined function error

Posted on 2008-11-06
Last Modified: 2012-08-13
Hi, I am trying to update a php file through another php file but am receiving the following error:

Fatal error: Call to undefined function file_put_content() in c:\Inetpub\wwwroot\putcontent.php on line 5

My code below:


$my_file = "some_file.php";

$f_content = file_get_contents($my_file);

$string_data = "Lorem ipsum";

file_put_content($fh, $string_data);



<html >




<div id="my_div">





Open in new window

Question by:Rassac
    1 Comment
    LVL 82

    Accepted Solution

    you missed an "s"


    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
    Both Easy and Powerful How easy is PHP? (  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to count occurrences of each item in an array.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now