Search Results

Search found 1 results on 1 pages for 'user1907696'.

Page 1/1 | 1 

  • PHP $array[0] in $string for JSON

    - by user1907696
    I am trying to use PHP to make a JSON file. Part of the code is as follow $array = array("hello", "world"); $string='{"person": [ { "name":'$array[0];', "age":'$array[1];' } ] }'; The file created. However, $array[0] and $array[1] doesn't return the values "hello" and "world" but as $array[0] and $array[1] Any idea? Thanks

    Read the article

1