I am trying to build upon the entity converter that takes code and prints out any HTML entities. I have it all working. I am just curious about removing the whitespace while maintaining the code on each line. I know that sounds confusing but I’ll try and give an example.
The HTML:
<form method="post" >
<h3>Encode:</h3>
<textarea name="codeArea">Enter your code here...</textarea>
<input class="btn btn-primary" type="submit" value="Encode!">
</form
The PHP:
[php]
'.htmlentities($UserInputText).''; ?>
[/php]
Currently if I input:
[php]
Value of variables inside the function
"; echo "Variable cost is: $cost"; echo "Variable tax is: $tax
"; } totalPrice(); echo "
"; echo "
"; echo "
Value of variables outside the function
"; echo "Variable cost is: $cost"; echo "" // echo "Variable tax is: $tax"; ?>
[/php]
I want it to output the results without all the spacing but keep the code on separate lines
Currently I am getting this as the output:
<?php $cost = 8.50; function totalPrice(){ $tax = 2.50; echo "<h2>Value of variables inside the function</h2>"; echo "Variable cost is: $cost <br />"; echo "Variable tax is: $tax <br />"; } totalPrice(); echo "<br />"; echo "<br />"; echo "<h2>Value of variables outside the function</h2>"; echo "Variable cost is: $cost"; echo "<br />" // echo "Variable tax is: $tax"; ?>