denyIpAddress - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of denyIpAddress.php

  1. <?php
  2. $thisIp ='36.55.84.121';
  3. $denyIpAddress = array(
  4.     '36.55.84.120',
  5.     '192.168.56.1',
  6.     '10.0.20.22'
  7. );
  8.  
  9. if ( !empt($thisIp) ) {
  10.     if ( in_array($thisIp, $denyIpAddress, TRUE) ) {
  11.         printf("Cannot use this IP Address: %s", $thisIp);
  12.     }
  13. }
  14.  
  15.  
File Description
  • denyIpAddress
  • PHP Code
  • 06 Feb-2020
  • 261 Bytes
You can Share it: