⊗ppPmFSFWr 332 of 447 menu

Writing Files in PHP

Now let's learn how to write data to files. For this purpose, the function file_put_contents is used, which takes the path to the file as the first parameter, and the text we want to write as the second.

As an example, let's write some text to the file test.txt:

<?php file_put_contents('test.txt', '!'); ?>

Given an array with numbers. Find the sum of these numbers and write the result to the file sum.txt.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline