Login
Remember
Register
Gaurav Agarwal Q&A Hub
Questions
Unanswered
Tags
Categories
Users
Ask a Question
Ask a Question
Write a PHP program to initialize an array with 5 integers and print each element.
0
votes
asked
Jun 18, 2024
by
digitalgaurav
(
1.2k
points)
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Jun 18, 2024
by
digitalgaurav
(
1.2k
points)
<?php
$arr = array(10, 20, 30, 40, 50);
foreach ($arr as $value) {
echo $value . "\n";
}
?>
Please
log in
or
register
to add a comment.
Welcome to Gaurav Agarwal Q&A Hub, where you can ask questions and receive answers from other members of the community.
Related questions
Write a php program to count the frequency of each element in an array.
Write a php program to split an array into chunks of 2 elements each.
Write a php program to search for a specific element in an array.
Write a php program to convert an array to a comma-separated string and back to an array.
Write a PHP program to sort an array in ascending and descending order.
Write a PHP program to find the maximum and minimum elements in an array.
Write a php program to chunk an array into smaller arrays of a specified size.
Write a php program to reduce an array to a single value using a callback function.
Write a php program to apply a callback function to all elements of an array.
Write a php program to reverse the elements of an array.
...