---
title: "PHP Scripts Collection - Joomla"
description: "Here you can find a collection of ready PHP Scripts that you can use within the extensions as well as anywhere you desire. How to check if current da"
url: "https://www.tassos.gr/docs/joomla/tutorials/php-scripts-collection"
date: "2026-04-23T16:27:15+00:00"
language: "en-GB"
---

[ Home ](https://www.tassos.gr/index.php?option=com_content&view=category&layout=blog&id=24&Itemid=1088) / [ Joomla ](https://www.tassos.gr/index.php?option=com_content&view=category&id=91) / [ Tutorials ](https://www.tassos.gr/index.php?option=com_content&view=category&id=92)

#  PHP Scripts Collection

Heads up! This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or 3rd party development.

Here you can find a collection of ready PHP Scripts that you can use within the extensions as well as anywhere you desire.

## [How to check if current day of week is Saturday or Sunday](#check_date_is_weekend)

Below you can find a PHP snippet that will allow you to check whether the current day of the week is a weekday.

 ```

use Joomla\CMS\Factory;

// Method that checks whether the current day of week is either Saturday or Sunday using Joomla API
function isWeekend()
{
    // Comma separated list of days to check. Sunday = 7
    $allowDays = array(6,7);

    // Do not edit below
    return in_array(Factory::getDate()->format('N'), $allowDays);
}

// Call method
if (isWeekend())
{
    echo 'Hooray! is weekend!';
}
```

## [How to check if a user has certain cookies stored in their browser](#check_user_browser_cookies)

Below you can find a PHP snippet that will allow you to check if a user has certain cookies stored in their browser.

 ```

use Joomla\CMS\Factory;

// Method that checks if multiple cookies exist using Joomla API
function cookiesExist($cookies)
{
    foreach ($cookies as $cookie)
    {
        if (!$pass = (bool) Factory::getApplication()->input->cookie->get($cookie))
        {
            return false;
        }
    }

    return true;
}

// The cookie names to check
$cookies = [
    'some_cookie_a',
    'some_cookie_b',
    'some_cookie_c'
];

// Check cookies
if (cookiesExist($cookies))
{
    echo 'All cookies exist!';
}
```

 Last updated on Feb 26th 2026 15:02

## Schema

```json
{
    "@context": "https://schema.org",
    "@type": "BreadcrumbList",
    "itemListElement": [
        {
            "@type": "ListItem",
            "position": 1,
            "name": "Home",
            "item": "https://www.tassos.gr"
        },
        {
            "@type": "ListItem",
            "position": 2,
            "name": "Home",
            "item": "https://www.tassos.gr/docs"
        },
        {
            "@type": "ListItem",
            "position": 3,
            "name": "Joomla",
            "item": "https://www.tassos.gr/docs/joomla"
        },
        {
            "@type": "ListItem",
            "position": 4,
            "name": "Tutorials",
            "item": "https://www.tassos.gr/docs/joomla/tutorials"
        },
        {
            "@type": "ListItem",
            "position": 5,
            "name": "PHP Scripts Collection",
            "item": "https://www.tassos.gr/docs/joomla/tutorials/php-scripts-collection"
        }
    ]
}
```

```json
{
    "@context": "https://schema.org",
    "@type": "Article",
    "mainEntityOfPage": {
        "@type": "WebPage",
        "@id": "https://www.tassos.gr/docs/joomla/tutorials/php-scripts-collection"
    },
    "headline": "PHP Scripts Collection",
    "image": {
        "@type": "ImageObject",
        "url": "https://www.tassos.gr/"
    },
    "publisher": {
        "@type": "Organization",
        "name": "Tassos",
        "logo": {
            "@type": "ImageObject",
            "url": "https://www.tassos.gr/https://www.tassos.gr/media/brand/logo-text.png"
        }
    },
    "author": {
        "@type": "Person",
        "name": "Stergos Zamagias",
        "url": "https://www.tassos.gr/docs/joomla/tutorials/php-scripts-collection"
    },
    "datePublished": "2020-02-27T10:58:59+02:00",
    "dateCreated": "2020-02-27T10:58:59+02:00",
    "dateModified": "2026-02-26T15:32:36+02:00"
}
```
