Skip to content

Instantly share code, notes, and snippets.

@rwaddin
Last active June 30, 2020 14:18
Show Gist options
  • Save rwaddin/5e40b34b102d0ec6f0535069a820be44 to your computer and use it in GitHub Desktop.
Save rwaddin/5e40b34b102d0ec6f0535069a820be44 to your computer and use it in GitHub Desktop.
setting web with json just 1 index, you can modify :)
<?php
if (! function_exists('setting'))
{
function setting($index = false)
{
if (file_exists("./setting.json") AND $index) {
$json = file_get_contents('./setting.json');
$data = json_decode($json,true);
return (isset($data[$index])) ? $data[$index] : false;
}
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment