I am making a website. I decided to try and do some php with it but am having trouble as I have only very basic knowledge of php. Basic enough to not be able to get a counter to work. This counter needs to count .json files that the bitpay api gives me. What I am trying to do is count how many purchases there were, the bitpay api gives me .json files for each purchase. I then want to update different things on the webpage by that number. Like 0-10 purchases shows picture one, 11-20 shows picture two. So far I have been testing with .jpg files and trying to just output the count.
[php]<?php
if $file=scandir("/Invoices");
$result=count($file);
echo $result
?>[/php]
[php]<?php
$directory = “…/images”;
if (glob($directory . “.jpg") != false)
{
$filecount = count(glob($directory . ".jpg”));
echo $filecount;
}
else
{
echo 0;
}
?>[/php]
Thanks for the help already