How can I write this PHP code in JavaScript?
I have no knowledge about JavaScript… :-s
<?php
$pozethumb=scandir("./pics/flori/thumbs");
$size=count($pozethumb);
$nrpoze=$size-2;
for($i=2;$i<$size;$i++)
{
echo"<img src=\"./pics/flori/thumbs/$pozethumb[$i]\" class=\"thumb\" sou=\"$pozethumb[$i]\" />";
}
?>
Consider familiarizing yourself with nodejs. It requires you to have a serverside V8 JS engine installed on the server. This would allow you to use ECMAScript/JavaScript on the server, e.g. list files on the filesystem of the server and query it from the client.
See the API docs
and
You might also be interested in phpjs, which aims to port PHP functions to PHP (doesnt have
scandirthough and I’m really not sure what to think of that in general anyway).