Welcome to WebmasterWorld Guest from 54.159.50.111

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

How to hide code in php

     
5:54 pm on Aug 28, 2008 (gmt 0)

New User

5+ Year Member

joined:Aug 9, 2008
posts:34
votes: 0


okay this is a stupid question but im stuggling .

/* is in css

but what is it in php ?

6:23 pm on Aug 28, 2008 (gmt 0)

New User

10+ Year Member

joined:Aug 22, 2005
posts:19
votes: 0


//this is a single line comment
#this is also a comment

/*
And this is a multi line comment
*/

6:24 pm on Aug 28, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member eelixduppy is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 12, 2005
posts:5966
votes: 0


These are called comments. There are two types in PHP.

Single-line comments:


# This is a comment
// ...and another

Or multiple-line comments:


/*
Here is some text blah blah
and some more
blah
here
*/


:)

[edit]
beaten to it ;)

6:26 pm on Aug 28, 2008 (gmt 0)

New User

5+ Year Member

joined:Aug 9, 2008
posts:34
votes: 0


Thanks
1:06 am on Aug 29, 2008 (gmt 0)

New User

10+ Year Member

joined:Aug 22, 2005
posts:19
votes: 0


probably the only question I could answer on the php board :)
7:56 pm on Aug 29, 2008 (gmt 0)

New User

5+ Year Member

joined:Aug 29, 2008
posts:24
votes: 0


Also if for some weird reason you don't like to use new lines, you can embed a comment into a line by doing:

$expression = /*Why would you ever do this?*/ 'help me';