|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
putting html snippets in php
does it go like this?
echo '<table blah blah blah' |
|
#2
|
||||
|
||||
|
er,
echo "<br><b>Title</b><br>"; ect. |
|
#3
|
|||
|
|||
|
does it require the <br>??
|
|
#4
|
||||
|
||||
|
no, thats just some example HTML
like: echo "<u>Hi</u>"; echo "<table width=10%>"; etc. just use echo " html and then "; |
|
#5
|
|||
|
|||
|
thanks
|
|
#6
|
||||
|
||||
|
Forgive me if I'm wrong but isn't the normal way of outputting HTML in PHP to break out of PHP and just type it normally?
__________________
~ishnid; Have you tried: [ search.cpan.org | perldoc | Java API | mysql.com | google ] Apostrophes are NOT used for possessive pronouns or for noun plurals, including acronyms. |
|
#7
|
||||
|
||||
|
You can do that and I do that for large blocks of HTML. But if you are printing out small amounts breaking in and out of HTML is very unreadable. Its easier to read and debug if you use PHP to print it. Also you dont have to enter the PHP brackets each time you want to use a variable.
|
|
#8
|
||||
|
||||
|
btw, if using php(4?) then you can do <?=$variable ?> to print a variable when out of php scripts.
|
|
#9
|
||||
|
||||
|
yes, if the server supports it, it has to be enabled in the INI file for that to work.
Its also considered lazy and most editors that do syntax highlighting will fail to highlight it. It also makes the code a lot less portable. |
|
#10
|
||||
|
||||
|
fine for me..... btw, should i shove this to the php forum?
|
|
#11
|
||||
|
||||
|
nah, doesnt really matter, This is a real beginners PHP question
![]() I doubt too many people will be looking for it to answer their question |
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > putting html snippets in php |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|