how can I implement a line break in a variable in php?

You can use nl2br function of php:

$a = "apple \r\n orange \r\n banana";
echo nl2br($a);

Break tag would do that job

<?php
 $str = "Hello world!";
 echo $str;
 echo "<br>What a nice day!";
 ?>

output:

Hello world!
What a nice day!

So in your case, it will be $a = "apple <br> orange <br> banana"; echo $a