convert array 90 degree - 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 convert array 90 degree.php
- <?php
- $array = [
- 0=>[1,2,3],
- 1=>[4,5,6],
- 2=>[7,8,9],
- ];
- $res = [];
- $array = array_reverse($array);
- $countArray = count($array)-1;
- for ($i = 0; $i <= $countArray ; $i++){
- $temp = [];
- foreach($array as $key=>$arr){
- $temp[] = $arr[$i];
- }
- $res[] =$temp;
- }
- print_r($res);
File Description
- convert array 90 degree
- PHP Code
- 30 Jan-2020
- 328 Bytes
You can Share it:
Latest PHP Pastes