Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/full-stack-web-developer-and-designer/php-function-check-capacity
A PHP custom function to check if the number of attendees for an event is below capacity for a specific venue.
https://github.com/full-stack-web-developer-and-designer/php-function-check-capacity
mirnesglamocic php phpfunction
Last synced: about 20 hours ago
JSON representation
A PHP custom function to check if the number of attendees for an event is below capacity for a specific venue.
- Host: GitHub
- URL: https://github.com/full-stack-web-developer-and-designer/php-function-check-capacity
- Owner: full-stack-web-developer-and-designer
- License: mit
- Created: 2023-01-27T16:59:14.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-01-28T13:47:04.000Z (almost 2 years ago)
- Last Synced: 2024-11-12T23:26:33.857Z (2 months ago)
- Topics: mirnesglamocic, php, phpfunction
- Language: PHP
- Homepage: https://replit.com/@MirnesGlamocic/PHP-function-event-capacity#index.php
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP function check capacity
This repository contains a custom **PHP function** for compare two values and check if the number of attendees for an event is below capacity for a particular venue. So, is given a list of places, capacity and registered participants, and using the PHP function **check_capacity()** the capacity for participant registration is compared and returned one of the two messages.If the number of attendees is bellow the venues capacity return _"There are still tickets available!"_ If the number of attendees is equal to or above the venues capacity return _"This event is sold out!"_. Function **check_capacity()** accepts two arguments, the capacity and the number of attendees.
The input will be a two dimensional array where the key is a venue name and the value is a two element array of capacity and attendees. The default value for attendees in the check capacity function is zero. So, the function **check_capacity()** will print the name of the venue, then the message returned by the **check_capacity()** function.
---
To check how it looks, click on the preview and then on the green run button.
##
[PREVIEW](https://replit.com/@MirnesGlamocic/PHP-function-check-capacity?v=1)