jeroen - PHP Online
Form of PHP Sandbox
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of jeroen.php
- <?php
- //Enter your code here, enjoy!
- $array = array(0 => array('id' => 10, 'title' => "PHP code tester Sandbox Online"),
- 1 => array('id' => 15, 'title' => "bar", 5 , 5 => 89009),
- 2 => array('id' => 20, 'title' => "Random Stuff: " . rand(100,999)),
- );
- $newArray = array();
- foreach( $array as $value ){
- $newArray[$value['id']] = $value['title'];
- //$newArray[] = array(
- // $value['id'] => $value['title']
- // );
- }
- print_r($newArray);
- /*
- Array
- (
- [10] => PHP code tester Sandbox Online
- [15] => bar
- [20] => Random Stuff: 276
- )
- */
File Description
- jeroen
- PHP Code
- 18 Oct-2019
- 637 Bytes
You can Share it:
Latest PHP Pastes