Skip to content

Instantly share code, notes, and snippets.

View asciito's full-sized avatar
🎯
Focusing

Ayax Córdova asciito

🎯
Focusing
View GitHub Profile
@asciito
asciito / helpers.php
Last active October 6, 2023 19:14
PHP - Helper Functions
<?php
if (! function_exists('join_paths')) {
/**
* Join two or more paths together
*/
function join_paths(string ...$paths): string
{
$first = array_shift($paths);
<?php
session_start();
/**
* Flash a message in the session, or get a message from the session
**/
function flash(string $key, string $message = null)
{
if (empty($message)) {
$message = $_SESSION[$key] ?? null;