Skip to content

Instantly share code, notes, and snippets.

@mehdichaouch
Last active September 28, 2016 14:00
Show Gist options
  • Save mehdichaouch/ba7d5aa546ad8f5f7badf7b7ac845593 to your computer and use it in GitHub Desktop.
Save mehdichaouch/ba7d5aa546ad8f5f7badf7b7ac845593 to your computer and use it in GitHub Desktop.
PHP Snippet to test code only with white-list IP, without disturbing other people
<?php
// @author : https://gist.github.com/mehdichaouch
/** BEGIN DEV ****************************/
try {
$clientIp = isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : '';
$teamIp = array(
'10.71.3.17', //mehcha
'YOUR IP',
);
if (in_array($clientIp, $teamIp)) {
var_dump(
);
//Zend_Debug::dump();
}
} catch (Exception $e) {
}
/** END DEV ****************************/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment