Skip to content

Instantly share code, notes, and snippets.

@huuyafwww
Created June 6, 2020 09:15
Show Gist options
  • Select an option

  • Save huuyafwww/b044bfa3463011ecf3c563fcb9184532 to your computer and use it in GitHub Desktop.

Select an option

Save huuyafwww/b044bfa3463011ecf3c563fcb9184532 to your computer and use it in GitHub Desktop.

Revisions

  1. huuyafwww created this gist Jun 6, 2020.
    27 changes: 27 additions & 0 deletions dynamic_foreach_constant_define.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    <pre>
    <?php

    $define_names = [
    "A" => "a",
    "B" => "b",
    "C" => "c",
    "D" => "d",
    "E" => "e",
    ];

    foreach(
    $define_names
    as
    $define_name
    =>
    $var
    ){
    define(
    $define_name,
    $var
    );
    }

    print_r(
    get_defined_constants()
    );