Checking if a value is set

PHOTO EMBED

Wed Jul 13 2022 11:53:53 GMT+0000 (Coordinated Universal Time)

Saved by @kalehm #php

$page = isset($_GET['page']) ? $_GET['page'] : '1' // setting the default value to '1'
 
or in php 7 the more shortcut way is
 
$page = $_GET['page'] ?? '1';
content_copyCOPY

https://www.thiscodeworks.com/checking-if-a-value-is-set/62ce5ca63289bc001593cfd5