Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2015
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. # PHP allowed URLs for Route
  2.  
  3. ```php
  4.  
  5. <?php
  6.  
  7. $private_urls = array(
  8. 'temrns-conditions',
  9. 'contact',
  10. 'faq',
  11. 'confirmation'
  12. );
  13.  
  14. $urls = implode('|', $private_urls);
  15.  
  16. if (preg_match('(^(?!(' . $urls . ')$)[A-Za-z0-9][A-Za-z0-9_-]{2,254}$))')) {
  17. echo 'Allowed';
  18. } else {
  19. echo 'Denied';
  20. }
  21.  
  22. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement