| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| NamePros Member | PHP Help First of all I'm new to php and I need some text to be centered using php code. How do I go aobut doing that? Thanx in advance.
__________________ One Thing I [I as in you] Have Learned | Share one of your life lessons. Experiencing College | A walk through of my first college experience. |
| |
| | #2 (permalink) |
| New Member | Welcome to PHP ![]() You wouldn't center text in PHP, it would still be done in HTML, just being sent to the browser using the php print() construct: PHP Code: |
| |
| | #3 (permalink) |
| NamePros Regular | Don't count on using style attributes inside div tags; not all platforms support this (think IE on pocket PC for one). It won't validate as anything but html 4.01 transitional or lower, but you can use this: PHP Code: |
| |
| | #4 (permalink) | |
| Adrian | Quote:
![]() PHP Code:
__________________ | |
| |
| | #5 (permalink) | |
| Senior Member | Quote:
Try it and see the following is perfectly valid php:- PHP Code: | |
| |
| | #8 (permalink) | |
| NamePros Regular | Quote:
__________________ Paris loves CityPics muov.com • qeww.com • sejz.com • viuo.com • vuav.com • wzeo.com • xeib.com • xueo.com -- Do not let others be treated this way! | |
| |
| | #11 (permalink) | |
| Senior Member | Quote:
And you are correct extra processing time will be taken up if you have non php in php tags as it will go through the php engine for no reason. Regarding the ; it is not necessary in the above example as the ?> comes directly after the command (I double checked and it worked 100%). However of course best practice always dictates the use of it. | |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |