K
K
Kooper_pro2018-03-23 15:18:35
PHP
Kooper_pro, 2018-03-23 15:18:35

How to add data to a string through a loop?

$pre_response='';
for ($i=0; $i <2; $i++) { 
  $pre_response.='<div class="line_items"></div'; 
}
echo $pre_response;

Displays 1 block with class line_items. Why? Or I misunderstood something?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2018-03-23
@Kooper_pro

Because your closing tag is not closed

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question