Jump to content

[SOLVED] PHP Function and Text Align


drummer101

Recommended Posts

<?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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.