<?php
session_start();
// Set session variables
$_SESSION['username'] = 'john_doe';
$_SESSION['user_id'] = 123;
// Display session data
echo "Username: {$_SESSION['username']}, User ID: {$_SESSION['user_id']}";
?>
<?php
session_start();
// Set session variables
$_SESSION['username'] = 'john_doe';
$_SESSION['user_id'] = 123;
// Display session data
echo "Username: {$_SESSION['username']}, User ID: {$_SESSION['user_id']}";
?>
Related
Create a PHP function to count the number of vowels in a string. |
How to reverses a given string using PHP. |
Create a PHP script that counts the number of occurrences of each word in a given sentence. |
Write a PHP function to check if a given string is a palindrome |
how to get response status in api using curl php? |
How to prevent SQL Injection using php |
what is PhpUnit? |
how to get current latitude and longitude using google map api in php? |
