Mode:
Duration:
1
2
3
4
<?php
$file = 'data.txt';
file_put_contents($file, 'Hello PHP\n', FILE_APPEND);
echo nl2br(file_get_contents($file));Coding works best on desktop or with an external keyboard.
<?php
$file = 'data.txt';
file_put_contents($file, 'Hello PHP\n', FILE_APPEND);
echo nl2br(file_get_contents($file));Coding works best on desktop or with an external keyboard.
Writes and reads from a text file using PHP.
<?php
$file = 'data.txt';
file_put_contents($file, 'Hello PHP\n', FILE_APPEND);
echo nl2br(file_get_contents($file));PHP is a widely-used, open-source, server-side scripting language designed for building dynamic web applications, powering over 75% of websites. Known for its simplicity, massive ecosystem, and deep integration with databases and the web, PHP remains a core backend technology behind platforms like WordPress, Facebook (early), and Wikipedia.
Origin & Creator
Created by Rasmus Lerdorf in 1995 as ‘Personal Home Page Tools’. It evolved into PHP 3/4 with Zend Engine, then PHP 5 introduced OOP, PHP 7 delivered massive performance improvements, and PHP 8 added JIT compilation, attributes, union types, enums, fibers, and major language modernization.
Industrial Note
PHP dominates the CMS ecosystem-WordPress, Drupal, Joomla. It powers Laravel and Symfony large-scale enterprise apps, e-commerce platforms like Magento, and millions of shared-hosting-based businesses. Used by Meta (legacy), Slack internal tools, Mailchimp, Etsy, and Wikipedia.