PHP code example of balambasik / input
1. Go to this page and download the library: Download balambasik/input 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/ */
balambasik / input example snippets
Balambasik\Input;
// $_POST
$post = Input::post();
// $_POST["foo"]
$foo = Input::post("foo");
// nested $_POST["foo"]["bar"]["baz"]
$baz = Input::post("foo.bar.baz");
// default value - if the key is not set
$bar = Input::post("foo.bar", "default");
// custom delimiter
Input::setDelimiter(":");
$baz = Input::post("foo:bar:baz", "default");
// methods
Input::get(); // $_GET
Input::post(); // $_POST
Input::request(); // $_REQUEST
Input::cookie(); // $_COOKIE
Input::session(); // $_SESSION
Input::server(); // $_SERVER
// any array
$bar = Input::arr($array, "foo.bar", "default");