drummer101 Posted November 29, 2008 Share Posted November 29, 2008 <?php function title($pageTitle){ echo "<div align=\"center\">" . $pageTitle . "</div>"; } title("Test"); ?> Should align "Test" center aligned on the page, but returns left aligned text instead. <?php $test = "Test"; echo "<div align=\"center\">" . $test . "</div>"; ?> However functions correctly. What did I screw up? Link to comment https://forums.phpfreaks.com/topic/134733-solved-php-function-and-text-align/ Share on other sites More sharing options...
genericnumber1 Posted November 29, 2008 Share Posted November 29, 2008 They should function identically. Link to comment https://forums.phpfreaks.com/topic/134733-solved-php-function-and-text-align/#findComment-701584 Share on other sites More sharing options...
drummer101 Posted November 29, 2008 Author Share Posted November 29, 2008 They should function identically. Correct, and thats the point. They're not. Link to comment https://forums.phpfreaks.com/topic/134733-solved-php-function-and-text-align/#findComment-701588 Share on other sites More sharing options...
Mark Baker Posted November 29, 2008 Share Posted November 29, 2008 They should function identically. Correct, and thats the point. They're not. Have you looked at the HTML that they're both generating to see what differences there might be? Link to comment https://forums.phpfreaks.com/topic/134733-solved-php-function-and-text-align/#findComment-701611 Share on other sites More sharing options...
bzz Posted November 29, 2008 Share Posted November 29, 2008 http://bzz.zapto.org/blah.php They both align center for me. Link to comment https://forums.phpfreaks.com/topic/134733-solved-php-function-and-text-align/#findComment-701623 Share on other sites More sharing options...
drummer101 Posted November 29, 2008 Author Share Posted November 29, 2008 Bizarre. It all works now.:S Link to comment https://forums.phpfreaks.com/topic/134733-solved-php-function-and-text-align/#findComment-701937 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.