PHP code example of rep98 / unilib
1. Go to this page and download the library: Download rep98/unilib library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
rep98 / unilib example snippets
Core::start([
"route" => ROOT_PATH.'route.php',
"config" => ROOT_PATH.'setting.php',
]);
use UniLib\Utils\Session;
$s = Session::I(); // Esto inicializa la clase y verifica si session_start esta iniciado
$s->userId = 1; // Esto es los mismo que $_SESSION['userId'] = 1;
unset($s->userId); // Aqui destruimo solo userId
$s->destroy(); // Destruye todas las secciones