I'm putting together a php/mysql cookbook/recipe program. All works well except for one bug.
When enterting info from a form to add a recipe, for example the ingredients section, you naturally hit the carriage return after you add each ingredient, so that you go to the next line. This saves in mysql the same way. However, when I go to display the recipe, the ingredients do not have the line breaks in them. The output is failing to break the lines where it should. I have tried variations of
nl2br
$replText = ereg_replace("13","<br>",$ingredients);
$replText=str_replace("\n","<br>",$ingredients);
Nothing is working. I'm not sure if its where I'm placing these functions, or if its something in my php setup. I'm also wondering if I need to add something in the form itself. And is the stripslashes/addslashes command something to consider in doing this? Thnx