Answers for "for i loop php"

PHP
27

for loop php

<?php
	$fruits = ["apple", "banana", "orange"];
	for($i=0;$i<count($fruits);$i++){
    echo "Index of ".$i."= ".$fruits[$i]."<br>";
    }
  ?>
Posted by: Guest on December-28-2019
6

for i php

<?php
  
  for ($i = 1; $i <= 10; $i++) {
    echo $i;
  }
Posted by: Guest on January-26-2021
3

for in php

<?php
  $variable = '' ; 
	 for($counter=0;$counter<$limit;$counter++){
       //code 
     }
  ?>
Posted by: Guest on December-29-2021
0

php loop

1/**
2 * @Route("/programs/{program_id}/comment/{comment_id}", name="program_show_comment")
3 * @ParamConverter("program", class="App\Entity\Program", options={"mapping": {"program_id": "id"}})
4 * @ParamConverter("comment", class="App\Entity\Comment", options={"mapping": {"comment_id": "id"}})
5 */
6public function showProgramComment(Program $program, Comment $comment): Response
7{
8  return $this->render('comment.html.twig', [
9    'program' => $program,
10    'comment' => $comment,
11  ]);
12}
Posted by: Guest on May-30-2021

Browse Popular Code Answers by Language