PHP - Store information with NO database



PHP Snippet 1:

if (Modernizr.localstorage) { // with Modernizr
if (typeof(localStorage) != 'undefined' ) { // Without Modernizr

PHP Snippet 2:

localStorage.setItem("somePreference", "Some Value");

PHP Snippet 3:

var somePreference = localStorage.getItem("somePreference");

PHP Snippet 4:

localStorage.removeItem("somePreference");

PHP Snippet 5:

  <?php 
    setcookie("important", $importantFileName); 
  ?>

PHP Snippet 6:

  <?php 
    $importantFileName = $_COOKIE["important"]; 
  ?>

PHP Snippet 7:

<?php
return [
    'title' => 'Test Title',
    'desc' => 'Test Description',
    'heading' => 'Test Heading',
    'html' => <<<'vKf4BpA7en9' // using nowdoc
<div class="form">
</div>
vKf4BpA7en9
];

PHP Snippet 8:

$dataInArray = include 'storage/php_array/pages/contact.php';