get the head of a given list in PHP
![](https://cdn-icons-png.flaticon.com/512/5968/5968332.png)
PHP
🤖 Code Explanation
The code is written in PHP. It defines a function called getHead that takes an array as a parameter. The function returns the first element of the array. The code then calls the getHead function and passes the array $list as a parameter. The code outputs the first element of the array, which is 1.
![](https://cdn-icons-png.flaticon.com/512/5968/5968332.png)
More problems solved in PHP
![](https://cdn-icons-png.flaticon.com/512/5968/5968332.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968332.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968332.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968332.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968332.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968332.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968332.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968332.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968332.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968332.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968332.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968332.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968332.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968332.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968332.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968332.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968332.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968332.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968332.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968332.png)
![](https://cdn-icons-png.flaticon.com/512/5968/5968332.png)