0
I need some help, I would like to include a code within DELIMETER, but I’m not succeeding, someone can help me or propose another alternative. The function below shows all the quantity I have in stock, a customer’s way to choose the quantity at checkout!
Follow my code below:
$product = <<<DELIMETER
<a class="btn btn-default">
<select id ="quantidade" name="quantidade"> <?PHP for ($i = 0; $i <=$row['produto_quantidade']; $i++) echo "<option value=".$i.">".$i."</option>";
?> </select> </a>
DELIMETER;
What are you trying to do? Your "delimiter" is a string
heredoc
. Do you want to put a select with all the options inside it? That’s it?– Marcelo de Andrade
Heredoc behaves like any string, there is no way to execute a PHP code inside it. You need to work with string concatenation.
– Woss