String functions are used to manipulate the string data some of the string functions in PHP are
strlen() to get length of the string
str_replace() to replace a string from a larger string.
Q2 . how to use constants?
SOLUTION
We can define constants in a website and where ever we use it the value will be the same.
for example
define("Interview_ prep", "2college4knowledge");
Interview_ prep will have the defined value throught out the page.
Q3 . What are the sorting functions in PHP?
SOLUTION
Sorting functions are used to sort the arrays in a specific order.
For example simple sort function sorts the array in an ascending order.
Q4 . How does rsort sort the array passed to it as parameter in PHP?
SOLUTION
This function sorts the array in a descending order.
Q5 . How does ksort sort the array passed to it as parameter in PHP?
SOLUTION
It is used to sort associative arrays and it sorts it in ascending order according to the key.
Q6 . How does kvsort sort the array passed to it as parameter in PHP?
SOLUTION
It is used to sort associative arrays and it sorts it in descending order according to the key.
Q7 . How does asort sort the array passed to it as parameter in PHP?
SOLUTION
It is used to sort associative arrays and it sorts it in ascending order according to the value.
Q8 . How does asort sort the array passed to it as parameter in PHP?
SOLUTION
It is used to sort associative arrays and it sorts it in descending order according to the value.
Q9 . What is a cookie in PHP?
SOLUTION
It is a small piece of data that is stored in the client machine .This can be used again in the future to check the authenticity of the user or even track user preferences.
Q10 . What is a session in PHP?
SOLUTION
A session is the data stored in the server for point of time .The data expires after some time
This can mainly be used to keep a page logged on to for some time and log out after that time.