School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,145 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,807 people online right now. Registration is fast and FREE... Join Now!




Programming Reference Sheets: PHP

 

Programming Reference Sheets: PHP

skyhawk133

15 Aug, 2006 - 05:10 PM
Post #1

Head DIC Head
Group Icon

Joined: 17 Mar, 2001
Posts: 16,842



Thanked: 151 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 offlineProfile CardPM
+Quote Post


snoj

RE: Programming Reference Sheets: PHP

15 Aug, 2006 - 05:13 PM
Post #2

Now with 10% more nom!
Group Icon

Joined: 31 Mar, 2003
Posts: 3,369



Thanked: 29 times
Dream Kudos: 775
My Contributions
Already started!
User is offlineProfile CardPM
+Quote Post

rahulbatra

RE: Programming Reference Sheets: PHP

15 Aug, 2006 - 11:40 PM
Post #3

D.I.C Head
Group Icon

Joined: 28 Dec, 2005
Posts: 176



Thanked: 2 times
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
+Quote Post

rahulbatra

RE: Programming Reference Sheets: PHP

15 Aug, 2006 - 11:54 PM
Post #4

D.I.C Head
Group Icon

Joined: 28 Dec, 2005
Posts: 176



Thanked: 2 times
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
+Quote Post

skyhawk133

RE: Programming Reference Sheets: PHP

23 Aug, 2006 - 11:30 AM
Post #5

Head DIC Head
Group Icon

Joined: 17 Mar, 2001
Posts: 16,842



Thanked: 151 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 offlineProfile CardPM
+Quote Post

skyhawk133

RE: Programming Reference Sheets: PHP

16 Nov, 2006 - 08:42 AM
Post #6

Head DIC Head
Group Icon

Joined: 17 Mar, 2001
Posts: 16,842



Thanked: 151 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 offlineProfile CardPM
+Quote Post

William_Wilson

RE: Programming Reference Sheets: PHP

19 Nov, 2006 - 05:35 PM
Post #7

lost in compilation
Group Icon

Joined: 23 Dec, 2005
Posts: 4,622



Thanked: 88 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 offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 04:49AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month