PHP 31
Array foreach define (dev state) By micha on 1st June 2023 10:10:48 AM
  1. $currentSite = get_bloginfo('url');
  2. $stagingURLs_array = [
  3.         '/aliaz-vps-alfa01.ddns.net/',
  4.         '/mt7.ddns.net:82/'
  5. ];
  6.  
  7. foreach ($stagingURLs_array as $stagingURL) {
  8.         if (preg_match($stagingURL, $currentSite)) {
  9.                 $dev_state = TRUE;
  10.         } else {
  11.                 $dev_state = FALSE;
  12.         }
  13. }
  14. define('DEV', $dev_state);

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.