You are on page 1of 3

What is the difference between $message and $$message?

$message is a simple variable whereas $$message is a variable’s variable,which means


value of the variable. Example:
$user = ‘bob’
is equivalent to
$message = ‘user’;
$$message = ‘bob’;

How to capture content from the output buffer ? or Give me an


example for Output caching in php?
ob_start(); // start an output buffer
echo ‘This text is from the w3answers buffer*******
’; // output that will be stored in the buffer
$w3buffer = ob_get_contents(); // store buffer content in $w3buffer variable
ob_end_clean(); // stop and clean the output buffer
echo ‘This is not from the w3answers buffer!!!!!!!!
’;
echo $w3buffer;
?>
O/p

what is the php solution to dynamic caching ?


PHP offers an extremely simple solution to dynamic caching in the form of output buffering.

Are php strings immutable ?


PHP strings can be changed, but the most common practice seems to be to treat strings as
immutable.Strings can be changed by treating them as character arrays and assigning directly into
them, like this:
$my_string = “abcdefg”;
$my_string[5] = “X”;
print($my_string . “
”);
which will give the browser output:
abcdeXg
?>
what is Memcache?
Memcache is a technology which caches objects in memory where your web application can get to
them really fast. It is used by sites such as Digg.com, Facebook.com and NowPublic.com and is widely
recognized as an essential ingredient in scaling any LAMP application to handle enormous traffic.

Will persistent connection work in the CGI version of php ?


mysql_connect() vs mysql_pconnect()?
Persistent database connections work only in the module installation of PHP.
If you ask for a persistent connection in the CGI version,
you will simply get a regular connection.

How do I prevent Web browsers caching a page in php?


header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Pragma: no-cache');
?>

What is meant by Persistent Database Connections?


Persistent connections are links that do not close when the execution of your script ends.

what are the security tips you should know before developing
php/mysql web pages ?
1. Do not trust user input.
2. Validate user input on the server side.
3. Do not use user input directly in your MySQL queries.

What are the different functions in sorting an array?


asort()
arsort()
ksort()
krsort()
uksort()
sort()
natsort()

You might also like