Php?

does anyone have an url where i can read about text formatting in php?

i only find tutorials about how to do a mailing-form and things like that, but nothing easy like this

thanks in advance

echo() displays text. Inside an echo tag you use HTML tags…

echo("<FONT FACE="Verdana" SIZE="1">This is Text</FONT>")

I have to go now, I only a quick second to type that up, I hope it was a point in the right direction.

4:30am… tired… sleep :sleep:

thanks, great help :beam: , cause i know html quite good…

have you been to php.net? They have the language mapped out there and all the functions etc. …and if I remember right, maybe a few tutorials on starting off… but PHP is just html with extra functions available in <?php ?> blocks

err, no it’s not.

PHP is a very powerful full server side scripting language with similarities to javascript and C.

HTML is used primarily for formatting.

PHP has very little in the way of formatting text, as lostinbeta quite rightly said, you use HTML from within PHP. Just remember to escape " with \ or you’ll get an error. For example…

echo("<FONT FACE="Verdana" SIZE="1">This is Text</FONT>")

…would not work, however…

echo("<FONT FACE=\"Verdana\" SIZE=\"1\">This is Text</FONT>");

…would.

*Originally posted by dotbob *
err, no it’s not.

err, yes it is. You can have a PHP page with only html and no php. You can have a php page with HTML and php. And you can have a php page which is just php.

For anyone not too familiar with php, its a good way to think of php as being just html with other special scripting attatched to it.

PHP is just html with extra functions available in blocks

err, no it’s not.

You can have a PHP page with only html and no php. You can have a php page with HTML and php. And you can have a php page which is just php.

What’s the point of giving a php extension to a straight forward HTML page? This is pointless and is actually counter productive as the page will be sent via the PHP parser on every request.

Yes, you can include php WITHIN an HTML file but this does not make PHP similar to HTML. PHP is server side which ultimately means that all code written in PHP is parsed on the server BEFORE being output to the client.

HTML is not parsed by the server. HTML is parsed by the client browser. HTML to give a basic analogy is the glue that holds page content together, PHP is not. PHP (to give another analogy) is the brain that works out the code before sending the results to the client.

Conclusion, PHP cannot in any case be compared to HTML.

dotbob: I am not going to get into a PHP argument as I don’t know too too much on the subject. I don’t want to get myself in a corner, but also… I don’t believe you need to escape a character. Although my first code was indeed wrong (thanks for noticing) I believe you can also use…

echo("<FONT FACE='Verdana' SIZE='1'>This is Text</FONT>")

Using Single Quotes for any quotation marks inside the main Double Quotes of the echo.

yes. you also don’t need the parenthesis around the entire thing.


echo "whatever";

also works. and you can use print as well…

Hmm, I didn’t know about no parenthesis. Thanks for that tip.

I knew about print.