PHP functions Usage
1. Convert ASCII line into HTML line breaks
We can display text fetched from database or HTML form. In these cases all paragraphs merged together and displayed in a single line.
To change these, we can convert all Ascii line breaks into HTML line breaks using nl2br() in-built function.
<?php
$input = “This is
sample text
which is break into separate lines”;
echo nl2br( $input );
?>
2. Find filesize in kilobytes
The following example will display file size in kilobytes
echo number_format(filesize($filename)/1024).” Kb”;
