Skip to content

Instantly share code, notes, and snippets.

@djoudi
Last active March 26, 2023 11:35
Show Gist options
  • Save djoudi/c48167bb52b9010d8d2dbe9803d32588 to your computer and use it in GitHub Desktop.
Save djoudi/c48167bb52b9010d8d2dbe9803d32588 to your computer and use it in GitHub Desktop.
<?php
setcookie("zoom","dev web",time()+60);
echo $_COOKIE['zoom'];
?>
<?php
$dafault = (isset($_COOKIE['langs']))?$_COOKIE['langs']:"en";
$l = (isset($_GET['lg']))?$_GET['lg']:$dafault;
setcookie("langs",$l,time()+60);
$list = ["fr"=>"Bienvenue","ar"=>"مرحبا","en"=>"Welcom"];
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
</head>
<body>
<a href="lang.php?lg=fr">Franch</a>
<a href="lang.php?lg=ar">Arabic</a>
<a href="lang.php?lg=en">English</a>
<h3><?php echo $list[$l]; ?></h3>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment