- fread: documentation ( source)
- fopen: documentation ( source)
<?php
function display_artistika($int = 100)
{
for ($i = 0; $i <= $int; $i++) {
if (three_and_five($i))
{
echo "Inti";
}elseif (three($i) || five($i)) {
echo "".three() ? 'Artistika' : 'Solusitama' ."";
}else
{
echo $i;
}
}
}
function three_and_five($int)
{
return three($int) && five($int);
}
function three($int)
{
return ($int % 3) == 0;
}
function five($int)
{
return ($int % 5) == 0;
}
display_artistika();
function deret($int)
{
for ($i = 0; $i <= $int; $i++) {
for ($j = 0; $j <= $i; $j++) {
echo $j;
}
echo "\n";
}
}
deret(6);
$a = [ "Inti" , "Artistika", "Solusitama"];
foreach ($a as $str) {
echo $str;
}
function calculate_square($height=0, $width=0)
{
$f = fopen( 'php://stdin', 'r' );
echo "Tinggi :";
$height = (Int) fread();
echo "n";
echo "Lebar :";
$width = (Int) fread();
echo $height * $width;
}