Welcome Guest, Not a member yet? Register   Sign In
A Tip for Balancing Divs in PHP Echo Statements
#1

[eluser]Vik[/eluser]
Here's a way to make it easy to make sure divs that are contained in php echo statements in view files, are balanced.

- Copy the text of the view file to a text editor like BBEdit
- Add line numbers
- Use a command like BBEdits "Process Lines Containing" to copy just lines that have the text "div"
- Paste those lines into a file

After that it's pretty easy to see which </div> go with which <div> statements, and to see if any are unbalanced. The line numbers are there too, so it's easy to go back to the original file and add html or php comments to each </div> to say which open div it goes with.




Theme © iAndrew 2016 - Forum software by © MyBB