Posted By

Scooter on 04/11/09


Tagged


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

wizard04
leomancini


Homeland Security Advisory System


 / Published in: PHP
 

URL: http://reusablecode.blogspot.com/2009/04/homeland-security-advisory-system.html

Returns the current national threat level as a string.

  1. <?php
  2. /*
  3.   Copyright (c) 2009, reusablecode.blogspot.com; some rights reserved.
  4.  
  5.   This work is licensed under the Creative Commons Attribution License. To view
  6.   a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or
  7.   send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California
  8.   94305, USA.
  9.   */
  10.  
  11. // Obtain the current Department of Homeland Security threat level.
  12. function getThreatLevel()
  13. {
  14. return eregi_replace('.*CONDITION="(.*)" />', '\1', file_get_contents("http://www.dhs.gov/dhspublic/getAdvisoryCondition"));
  15. }
  16. ?>

Report this snippet  

You need to login to post a comment.