PHP Cookies and Session Tracking

Cookies: PHP supports the concept of cookies. Cookie is set using the setcookie function. This function takes in one or more parameters. The first parameter is the cookie name which is mandatory and is given as a string. The second parameter is “true” which is used to define a cookie. The third parameter is the […]

PHP File Handling

Files: In PHP it is possible to create, read, and write files on the server system. The first step is to open a file and associate it with a variable name. The variable is known as file variable. The fopen() function is used to perform the above operation of opening the form. This function takes […]

PHP Form Handling

Form handling:   The users interact with the web server through forms. The user fills the contents in the form and submits the form. The content of the form is transmitted to the server which process the data and returns the output in the form of response.   In PHP form data values are directly […]

PHP Output

Output: print function is used to create unformatted output it can be called with or without parentheses For example: print “This is Sample”; print(“This is Sample”); print “The Result is: $sum”; print (“The Result is: $sum”);   printf function is used to create formatted output. For example printf(“string”, para1, para2… paran)   The string can […]

PHP Strings

String Operations: Concatenation Operator:  . String variables individual characters can be accessed through { } Index of characters in string starts with zero String Functions: strlen() strcmp() strpos() substr() chop() trim() ltrim() strtolower() strtoupper()     Type Conversion: In PHP Explicit type conversion can be performed in three different ways: Type Casting for example $sum […]