Welcome to Dream.In.Code
Getting Help is Easy!

Join 117,527 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,949 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Programming Reference Sheets: PHP

 
Reply to this topicStart new topic

Programming Reference Sheets: PHP

skyhawk133
post 15 Aug, 2006 - 06:10 PM
Post #1


Head DIC Head

Group Icon
Joined: 17 Mar, 2001
Posts: 14,600



Thanked 39 times

Dream Kudos: 1650

Expert In: Web Development

My Contributions


115 lines, keep it basic. Syntax stuff for right now. Use the C++ sheet as a guide. Put important PHP stuff in.
User is online!Profile CardPM

Go to the top of the page


snoj
post 15 Aug, 2006 - 06:13 PM
Post #2


$Null

Group Icon
Joined: 31 Mar, 2003
Posts: 3,304



Thanked 5 times

Dream Kudos: 700
My Contributions


Already started!
User is offlineProfile CardPM

Go to the top of the page

rahulbatra
post 16 Aug, 2006 - 12:40 AM
Post #3


D.I.C Head

Group Icon
Joined: 28 Dec, 2005
Posts: 156



Dream Kudos: 275
My Contributions


Data Types
integer, float, boolean, string, array, object, resource, NULL

Comments
// Comment text
/* Multi-line comment text */
# Comment text


Arithmetic Operators
+ (Addition), - (Subtraction), * (Multiplication), / (Division), % (Modulus)

Relational Operators
== (Equal), === (Identical), != (Not equal), <> (Not equal), !== (Not identical), < (Less than), > (Greater than), <= (Less than or equal to), >= (Greater than or equal to)

Logical Operators
! (logical NOT), && (logical AND), || (logical OR), xor (logical XOR)
User is offlineProfile CardPM

Go to the top of the page

rahulbatra
post 16 Aug, 2006 - 12:54 AM
Post #4


D.I.C Head

Group Icon
Joined: 28 Dec, 2005
Posts: 156



Dream Kudos: 275
My Contributions


If Else
if (<condition>)
{ <statement 1>; }

else
{ <statement 2>; }


While Loop
while (<condition>)
{ <statement>; }


Do-While Loop
do
{ <statement>; }

while (<condition>);


For Loop
for (<initialize>;<condition>;<update>)
{ <statement>; }
User is offlineProfile CardPM

Go to the top of the page

skyhawk133
post 23 Aug, 2006 - 12:30 PM
Post #5


Head DIC Head

Group Icon
Joined: 17 Mar, 2001
Posts: 14,600



Thanked 39 times

Dream Kudos: 1650

Expert In: Web Development

My Contributions


hotsnoj, when you're all done can you post everything in a nice .txt file. Thanks!!!
User is online!Profile CardPM

Go to the top of the page

skyhawk133
post 16 Nov, 2006 - 09:42 AM
Post #6


Head DIC Head

Group Icon
Joined: 17 Mar, 2001
Posts: 14,600



Thanked 39 times

Dream Kudos: 1650

Expert In: Web Development

My Contributions


I wanted to revive this. I've setup a Google Docs so we can collaborate on this document.

You can find the current document here: http://docs.google.com/View?docid=dd8btbzw_0dm8xsk

If you'd like to collaborate on this document, PM/Post your email address and I will invite you to edit. We can edit the document in real time if you'd like.
User is online!Profile CardPM

Go to the top of the page

William_Wilson
post 19 Nov, 2006 - 06:35 PM
Post #7


lost in compilation

Group Icon
Joined: 23 Dec, 2005
Posts: 3,760



Thanked 7 times

Dream Kudos: 3275

Expert In: Java, C, Javascript

My Contributions


not allowed to modify the google doc:

//open php document
<?php //or
<script language="php">
//close php document
?> //or
</script>


//have code interpreted by html converter
echo 'statement to be converted'; //can include html,js etc statements

//switch
switch ($a) //int value
{
case 1: echo "case 1: \$a is $a<br>";break;
case 2: echo "case 2: \$a is $a<br>";break;
default: echo "neither case 1 or 2";
}

//type of variable
gettype($a) //if a = 3.14, displays 'double'

//type casting must become less significat (int from double)
$a = 3.14
&b = (int)$a //b is 3

//built in encryption
crypt($a) //most useful is $a is a string

//formatting:

%b
//binary value.

%c
//convert to int and print ascii

%d
//decimal value.

%f
//floating-point number.

%o
//octal value.

%s
//print as a string.

%X or %x
//hexadecimal value using uppercase letters.

//printf (same as C) displayed without interpreter
//print is also available
printf("$a and %b", $a); //displays $a then binary of $a from after ,
User is online!Profile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/7/08 03:51PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month