Skip to content

full-stack-web-developer-and-designer/PHP-function-check-capacity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

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

About

A PHP custom function to check if the number of attendees for an event is below capacity for a specific venue.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages