﻿
﻿
﻿
﻿<html>
 <head>
  <title>Test PHP</title>
 </head>
 <body>
 
 
 <?php
 
 ?>
 <?php
 
 ?>
 <?php
 
 ?>
 <?php
 
 ?>
 
 
 <?php echo "Hello World!<p>"; ?>
 
﻿ 
<?php

// current directory
echo getcwd() . "\n";

chdir('abigail-appunti');

// current directory
echo getcwd() . "\n";

?>





<?php
//
//below code only list files in directories and does not search sub-directories:


path to directory to scan. i have included a wildcard for a sub directory
$directory = "/var/www/joomla/isherwood/";

//get all image files with a .jpg extension.
$images = glob("" . $directory . "*.jpg");

$imgs = '';
// create array
foreach($images as $image){ $imgs[] = "$image"; }

//shuffle array
shuffle($imgs);

//select first 20 images in randomized array
$imgs = array_slice($imgs, 0, 1000);

//display images
foreach ($imgs as $img) {
    echo $img . '<br>';
}
?>

﻿
﻿<?php /* In questo script vedremo quali sono gli elementi che compongono un file PHP. Questo ad esempio è un commento multilinea. */

 // questo invece è un commento su singola riga 
 
 # questo è un altro tipo di commento 
 
 $nome = "Simone"; echo "Il mio nome è " . $nome;

 function stampa_nome($nome) 
 
 { echo "<strong>Ciao " . $nome . "</strong>"; } 
  ?>
 
 <h4>Where Does It Come From?</h4>
 
 <?phpstampa_nome($nome); ?>
﻿
﻿
﻿
﻿</body>
</html>