adspace
How can we know that a session is started or not?
Answer Posted / deep
we'll have to set a session variable after starting a
session as shown below
--------------------------------------------------
<?php
session_start();
if(isset($_SESSION['views']))
$_SESSION['views']=$_SESSION['views']+1;
else
$_SESSION['views']=1;
echo "Views=". $_SESSION['views'];
?>
--------------------------------------------------
it will set as well as increment the session variable
or we may simply echo a value to check whether a session is
started or not.
| Is This Answer Correct ? | 10 Yes | 0 No |
Post New Answer View All Answers
how to detect a mobile device using php
How to calculate the difference between two dates using php?
Write a program using while loop?
Explain me is it possible to destroy a cookie?
What is the current stable version of php? What advance thing in php7?
What is trait in php?
Tell me what kind of things have you done on the social side?
if you run the app program all vendor open items are cleared but is it possible to reverse the again again open items please tell me the answer
What is the difference between htmlentities() and htmlspecialchars()?
What is difference between static and final in php?
List some features of php that are deprecated in php7?
Name and explain five of the PHP error constants?
Which variable declarations within a class is invalid in php?
What is the current stable version of php?
sort term descripttion form, report and uery