Uncaught Error: Call to undefined function : <p>It was working but now it stops working why? it soppiest to write into a file and save it. it was working yesterday but today it stops and I can't figure out why a search the internet but still nothing I can't .</p>

<p>Thanks in advanced</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Contact us&lt;/title&gt;

    &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"&gt;&lt;/script&gt;  
           &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" /&gt;  
           &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;nav class="navbar navbar-default"&gt;
      &lt;div class="container-fluid"&gt;
        &lt;!-- Brand and toggle get grouped for better mobile display --&gt;
        &lt;div class="navbar-header"&gt;
          &lt;button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"&gt;
            &lt;span class="sr-only"&gt;Toggle navigation&lt;/span&gt;
            &lt;span class="icon-bar"&gt;&lt;/span&gt;
            &lt;span class="icon-bar"&gt;&lt;/span&gt;
            &lt;span class="icon-bar"&gt;&lt;/span&gt;
          &lt;/button&gt;

        &lt;/div&gt;

        &lt;!-- Collect the nav links, forms, and other content for toggling --&gt;
        &lt;div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"&gt;
          &lt;ul class="nav navbar-nav"&gt;
            &lt;li&gt;&lt;a href="aboutus.html"&gt;About US&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="contactus.php"&gt;Contact Us&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="property.php"&gt;Propertys&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;

        &lt;/div&gt;&lt;!-- /.navbar-collapse --&gt;
      &lt;/div&gt;&lt;!-- /.container-fluid --&gt;
    &lt;/nav&gt;

    &lt;h1&gt;Contact us&lt;/h1&gt;

    &lt;form  method="post" action="contactus.php" &gt;

        &lt;label&gt;Email&lt;/label&gt;
        &lt;input type="text" name="email" required&gt;
        &lt;br&gt;
        &lt;label&gt;Mobile number&lt;/label&gt;
        &lt;input type="number" name="number" required&gt;
        &lt;br&gt;
        &lt;textarea name="comments" required&gt;&lt;/textarea&gt;

        &lt;button name="submit" type="submit"&gt; submit&lt;/button&gt;


    &lt;/form&gt;

    &lt;?php

            if(isset($_POST['submit'])){
        $number = $_POST["number"];
        $email = $_POST["email"];

        $trueemail;


        $massage = $_POST["comments"];


        if(isset($number)){



            if (strlen($number) == 8) {

                $truenumber = true;
            }else{

                echo "Input your mobile number";

            }
        }   


        if(isset($email)){
        if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
            echo "&lt;br&gt;";
            echo "Enter a valid email";
        }else{
            $trueemail = true;
        }
    }

    if($trueemail == true &amp;&amp; $truenumber == true){
    writeToFile($email,$number,$massage);


    function writeToFile($trueemail,$truenumber,$massage)   
    {

            $myfile = fopen("contectus.txt", "w") or die("Unable to open file!");
            fwrite($myfile, $trueemail . PHP_EOL);
            fwrite($myfile, $truenumber . PHP_EOL);
            fwrite($myfile, $massage . PHP_EOL);
            fclose($myfile);
    }
}
}



    ?&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>
