Create an account


Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 20,161
» Latest member: hotswagonme
» Forum threads: 21,855
» Forum posts: 22,733

Full Statistics

Online Users
There are currently 1126 online users.
» 2 Member(s) | 1118 Guest(s)
Applebot, Baidu, Bing, Discord, Google, Yandex, hotswagonme, MrEzlo

 
  [Tut] How to use includes in JavaScript Array, String
Posted by: xSicKxBot - 03-29-2022, 11:37 AM - Forum: PHP Development - No Replies

How to use includes in JavaScript Array, String

by Vincy. Last modified on November 21st, 2021.

Coding in JavaScript is one of the critical skills required in building websites. Though mastering JavaScript is a journey to the center of the earth, continuous learning will help you make it.

We have seen some of the JavaScript functions like find(), forEach() earlier. Now, let’s learn about the function includes() in JavaScript.

Quick example



<script>
inputArray = ['Create', 'Read', 'Update', 'Delete', 'Filter'];
inputArray.includes('Read'); //returns true
inputArray.includes('Read','3'); //returns false
inputArray.includes('Error'); //returns false
inputArray.includes('Delete','-1'); //returns false inputString = 'How to learn JavaScript?';
inputString.includes('learn'); //returns true
inputString.includes('learn','8'); //returns false
</script>

About JavaScript includes


It checks if an array or string includes a given value.

In an array context, it checks the given value is one among the array elements. In the string prototype, the includes() in JavaScript checks if the given value is the substring.

Syntax, parameters and return value


includes(searchElement, [fromIndex]);

It has two parameters, searchElement and fromIndex. The fromIndex is optional and its default value is 0 to start with.

The fromIndex accepts signed numbers. With a negative value, it applies this formula to compute the position to start.

fromIndex = arrayLength + signedFromIndex

It returns boolean true if any match is found or false otherwise.

Note:

  • JavaScript includes() searches array or string with case sensitivity.
  • It can also be called as a generic method.
  • It works in most modern browsers.
  • The negative value is not applicable for the includes() in the String prototype.
  • The Array.prototype.includes() will not search for a sub-array.

include in javascript

Where to use JavaScript includes


The includes in JavaScript can be used for many scenarios. Some of them are listed below.

  1. To form a conditional code block based on the presence of the search element in an array or string.
  2. To highlight the keyword in the search result, if the includes in JavaScript returns true.
  3. To make the select, checkbox, radio options selected if the options found in the haystack.

Visit the linked article to know the other array prototype methods in JavaScript.

Examples for using includes in JavaScript


This article includes 4 examples to see how to use JavaScript includes(). Those are,

  1. To search array if a specified element exists or not.
  2. To use includes with a positive or negative fromIndex parameter.
  3. To use String.prototype.includes.
  4. To invoke includes() as a generic method.

Search array element using Includes in JavaScript


This example contains an array of 4 strings. It defines a custom function checkOption() to form a condition using includes().

This function receives a string and applies array.includes() on it. It returns Boolean true if the passed element is found on the array.

It prepares the output string based on the boolean value returned. It writes the log on the console to see the result of the program.

how-to-use-includes-in-javascript-array.php


<script> var optionArray = [ 'Create', 'Read', 'Update', 'Delete' ]; checkOption('Read'); checkOption('Filter'); function checkOption(keyword) { var isIncludes = optionArray.includes(keyword); if(!isIncludes) { console.log(keyword + ": not exists"); } else { console.log(keyword + ": exists"); } }
</script>

Includes function with optional from-index parameter


It uses the optional fromIndex parameter while calling the includes() in JavaScript.

It supplies either positive or negative values in the second parameter. On getting a negative index, it computes the position from where it should start the search.

As passed -1 the computed position is 5, since arrayLength+negativeIndex = 6+(-1) = 5.

From the 5th position, it searches for ‘Pagination’ and returns true. When it searches for ‘Filter’ then it will return false.

javascript-includes-with-from-index.php


<script>
var optionArray = [ 'Create', 'Read', 'Update', 'Delete', 'Filter', 'Pagination' ]; console.log(optionArray.includes('Update', 2));
console.log(optionArray.includes('Update', 3));
console.log(optionArray.includes('Pagination', -1));
console.log(optionArray.includes('Filter',-1));
</script>

JavaScript string includes


It’s for using String.prototype.includes() in Javascript. It assigns a long string to a variable and searches the passed keyword on it.

It also receives fromIndex position. A negative index will create no change. This program uses the fromIndex default value 0 and searches the string end to end.

check-string-includes-substring.php


<script>
var inputString = "How much wood would a woodchuck chuck if a woodchuck could chuck wood?";
var result = inputString.includes("woodchuck");
console.log(result);
</script>

Invoke includes in JavaScript on array-like objects


JavaScript allows calling the includes() function as a generic method. In the above examples, the includes() is called with respect to this value representing an array or string context.

This example calls the includes in JavaScript on a functions’ argument list instead of an array.

how-to-call-includes-as-generic.php


<script>
(function() { console.log(Array.prototype.includes.call(arguments, 'Read', 1)); console.log(Array.prototype.includes.call(arguments, 'Read', -1));
})('Create', 'Read', 'Update', 'Delete') </script>

Similar JavaScript methods like includes


There are more functions in JavaScript as like as the includes(). The below list shows some of those functions.

  • find() – applies condition on an array and returns the first element satisfying the condition.
  • findIndex() – as like as find() but returns index instead of the value.
  • indexOf() – returns index by element value.
  • lastIndexOf() – returns last index of an input element. It makes difference if the there are multiple occurances of the passed element.

Conclusion


We have seen about the includes in JavaScript end to end. The above article contains the basic idea about this function. It covers a beginner’s level introductory section and the usage mechanisms.

The examples will make it clear how to use includes in JavaScript. I hope the scenarios to use and the list of related functions gives relevancy to get the idea.

Download

↑ Back to Top



https://www.sickgaming.net/blog/2021/11/...ay-string/

Print this item

  (Indie Deal) FREE Sping Bonus, Razer Gold Raffle, Flash Sales
Posted by: xSicKxBot - 03-29-2022, 11:37 AM - Forum: Deals or Specials - No Replies

FREE Sping Bonus, Razer Gold Raffle, Flash Sales

Sping Bonus FREEbie
[freebies.indiegala.com]
The astronomical Spring begins on the day of the equinox, while Easter is nearly a month away, so why not celebrate early with a small Bonus?

Razer Gold Promotional Raffle
[gold.razer.com]
Want to score some Razer Gear? Interested in some great game deals? Why not do both?! Use Razer Gold, enter the raffle and you could win big.

(NOTE: This Razer Gold Promotion is available only in the US region.)

Akupara, Europa Universalis IV, Annapurna Flash Sales
[www.indiegala.com]
[www.indiegala.com]
[www.indiegala.com]
Stay Inside, Stay Safe and Enjoy Good Games.
Check out IndieGala on Twitter, YouTube & Facebook[www.facebook.com]


https://steamcommunity.com/groups/indieg...0015480520

Print this item

  News - Asus Is Reducing Its Graphics Card Prices Across The Board
Posted by: xSicKxBot - 03-29-2022, 11:37 AM - Forum: Lounge - No Replies

Asus Is Reducing Its Graphics Card Prices Across The Board

While new, high-end graphics cards have been hard to get for some time, that's been changing recently. Supply has slowly been increasing, and as high school economics teaches us, the more of a product there is, the less it costs for consumers. PC hardware manufacturer Asus is already shifting its pricing according to that rule reports PC Gamer, meaning RTX 30 Series cards may finally be affordable.

In a series of statements to PC Gamer, Asus confirmed that it "is reducing MSRP aggressively." Specifically, the company has "been dropping pricing across all SKUs" of graphics cards, meaning prices won't just be dropping for Nvidia cards. Anyone who wants to get an Asus AMD card should also find lower prices, although it's not clear when Asus' reduced MSRPs will actually have an effect on what consumers see on store shelves. Currently, an Asus KO Nvidia' GeForce RTX 3070 V2 OC is $900 on Amazon, which is inflated far past the price of an AIB model for the card. Nvidia lists Founders Edition RTX 3070 graphics cards at a $500 MSRP.

While there isn't a clear change in pricing just yet, Asus' confirmation that it is lowering the MSRPs for its graphics cards is a great sign. We could soon see other AIB graphics cards manufacturers–Zotac, EVGA, MSI, Gigabyte, etc.--reduce their prices too.

Continue Reading at GameSpot

https://www.gamespot.com/articles/asus-i...01-10abi2f

Print this item

  (Free Game Key) DEMON'S TILT - Free Epic Game
Posted by: xSicKxBot - 03-29-2022, 11:37 AM - Forum: Deals or Specials - No Replies

DEMON'S TILT - Free Epic Game

Visit the store page and add the game to your account:

DEMON'S TILT[store.epicgames.com]

The game is free to keep until Mar 31th 2022 - 15:00 UTC.

Next week's freebie:
City of Brass
Total War: WARHAMMER

We are welcoming everyone to join our discord[discord.gg]. We are more active there on finding giveaways, small or large, and there are daily raffles you can participate.

?GrabFreeGames.com ?Twitter ?Steam Curator ?Facebook[fb.me]?Discord[discord.gg]
❤️Support us: ✔️HumbleBundle Partner[www.humblebundle.com] Epic Tag: GrabFreeGames


https://steamcommunity.com/groups/GrabFr...3700884899

Print this item

  PC - Babylon's Fall
Posted by: xSicKxBot - 03-29-2022, 11:37 AM - Forum: New Game Releases - No Replies

Babylon's Fall



Experience acclaimed developer PlatinumGames' signature combat in BABYLON’S FALL with up to 3 other players or take on the Tower of Babel alone, in this new cooperative action RPG. After the Babylonians perished, only their great tower “The Ziggurat” remained. Now a new Empire has come to pillage its ruins and uncover its fabled treasures. Join forces with other Sentinels, unwilling subjects forcibly implanted with Gideon Coffin, relics that grant the few survivors unrivalled powers. Ascend to greatness as you climb the looming Tower of Babel and uncover its fabled treasures. Only by mastering the powers of your Gideon Coffin, will you unlock your true potential and become strong enough to survive the summit and uncover the secrets that await. Pre-order BABYLON'S FALL to obtain a unique customization for your character, The Empress' Insignia. Show off to other Sentinels that you were one of the first to obtain a Gideon Coffin and become a Sentinel.

Publisher: Square Enix

Release Date: Mar 03, 2022




https://www.metacritic.com/game/pc/babylons-fall

Print this item

  [Tut] Is There A List Of Line Styles In Matplotlib?
Posted by: xSicKxBot - 03-28-2022, 07:29 AM - Forum: Python - No Replies

Is There A List Of Line Styles In Matplotlib?

You want to plot a series of data with unique styles. You need to pick various line styles from a list but not sure how to get started. This tutorial will help you out.

Yes, there is a list of line styles in matplotlib. To get the list, import the lines from the matplotlib library.

from matplotlib import lines

Next, get the keys from the lineStyle attribute.

lines.lineStyles.keys()

You can then print the styles and choose your preferred style per plot.

print(lines.lineStyles.keys())

The result is

dict_keys(['-', '--', '-.', ':', 'None', ' ', ''])

As you will see in this tutorial, you can also generate line styles using colors and markers. What is more? Find out below.

Lab Setup To explore Line Styles In Matplotlib


Assume we want to plot the annual earnings of company X’s employees (designers, developers, and accountants) aged between 20 and 29. We store the ages in a list as follows.

ages = [20, 21, 22, 23, 24, 25, 26, 27, 28, 29]

Next, we create lists for each group of employees’ salaries.

designers = [45893, 50375, 52000, 52009, 54000, 55555, 56979, 57040, 55991, 54000]
developers = [55893, 53375, 52000, 51008, 58000, 58555, 59979, 60050, 65991, 67000]
accountants = [40000, 41500, 42000, 42508, 43001, 44555, 46979, 48050, 49991, 51000]

Now that we have some data to practice various line styles in matplotlib, let’s go ahead and manipulate the data.

Practical Ways To Use Line Styles In Matplotlib


➥Get the required functions


Install the matplotlib library using pip.

pip install matplotlib
# OR
pip3 install matplotlib

After installing Matplotlib, create a file and import the library’s functions into it. I have created one called employees.py and imported lines and pyplot as follows.

from matplotlib import lines, pyplot as plt

We will get the line styles from lines and plot the lines with pyplot. It is a convention to shorten pyplot as plt. In simple words it is an alias.

➥Plot the data


Plotting a bunch of data on a curve requires specifying the values for the x-axis and y-axis.

plt.plot(<x-axis data list>, <y-axis data list>)

We can plot our employee values as follows.

ages = [20, 21, 22, 23, 24, 25, 26, 27, 28, 29] designers = [45893, 50375, 52000, 52009, 54000, 55555, 56979, 57040, 55991, 54000]
developers = [55893, 53375, 52000, 51008, 58000, 58555, 59979, 60050, 65991, 67000]
accountants = [40000, 41500, 42000, 42508, 43001, 44555, 46979, 48050, 49991, 51000] plt.plot(ages, designers)
plt.plot(ages, developers)
plt.plot(ages, accountants) plt.show()

The plt.show() function instructs Python to reveal the graphical information cached in the memory. As soon as you run the file on the terminal, you get three solid lines of different colors.

python employees.py
List of Line Styles in Python - Figure 1

Now let us label the lines and add a title to the plots for easier identification. Insert the code before the plt.show() line.

plt.xlabel("Ages")
plt.ylabel("Annual salary in USD")
plt.title("Salaries of X employees for 20-29 ages")

Output:

List of Line Styles in Python - Figure 2

However, we cannot tell what the green, blue, and coral lines represent. So, let’s mark the lines using labels and a legend.

labels

plt.plot(ages, designers, label='designers')
plt.plot(ages, developers, label='developers')
plt.plot(ages, accountants, label='accountants')

legend represents the area that describes specific elements of the graph. In this case, we will use the legend() method to describe the labels assigned previously.

plt.legend()
plt.show()

Output:

Displaying Legends in Graph

Full code: Here’s the full code that helps to represent our data in the form of different lines.

from matplotlib import lines, pyplot as plt ages = [20, 21, 22, 23, 24, 25, 26, 27, 28, 29] designers = [45893, 50375, 52000, 52009, 54000, 55555, 56979, 57040, 55991, 54000]
developers = [55893, 53375, 52000, 51008, 58000, 58555, 59979, 60050, 65991, 67000]
accountants = [40000, 41500, 42000, 42508, 43001, 44555, 46979, 48050, 49991, 51000] plt.plot(ages, designers, label='designers')
plt.plot(ages, developers, label='developers')
plt.plot(ages, accountants, label='accountants') plt.xlabel("Ages")
plt.ylabel("Annual salary in USD")
plt.title("Salaries of X employees for 20-29 ages") plt.legend() plt.show()

Looks better, right? Yes, but we can improve the visuals by changing the line styles.

?Change The Line Styles


We assigned different labels to distinguish different data but is there a way to change the style of the line? Yes! The first step is to grab the lines with the help of the lines module. You can import lines from matplotlib as we have done above or get them from Matplotlib line style docs.

Let’s print the styles from the imported lines. After commenting out the plt.show() method, run the print line below the import statement.

print(lines.lineStyles)

We get a dictionary which represents the type of styles in which the lines can be represented as follows:

{'-': '_draw_solid', '--': '_draw_dashed', '-.': '_draw_dash_dot', ':': '_draw_dotted', 'None': '_draw_nothing', ' ': '_draw_nothing', '': '_draw_nothing'}

Let’s find the keys and store them as list_styles.

line_styles = lines.lineStyles.keys()

We get a list on running printing line_styles.

print(line_styles)
dict_keys(['-', '--', '-.', ':', 'None', ' ', ''])

Let’s use the result to change line styles for the plots.

Combining the lines.lineStyles.keys() and pyplot.linestyle helps us change the designers and developers plots as follows.

from matplotlib import pyplot as plt ages = [20, 21, 22, 23, 24, 25, 26, 27, 28, 29] designers = [45893, 50375, 52000, 52009, 54000, 55555, 56979, 57040, 55991, 54000]
developers = [55893, 53375, 52000, 51008, 58000, 58555, 59979, 60050, 65991, 67000]
accountants = [40000, 41500, 42000, 42508, 43001, 44555, 46979, 48050, 49991, 51000] plt.plot(ages, designers, label='designers', linestyle='--')
plt.plot(ages, developers, label='developers', linestyle=':')
plt.show()

Output:


Here, lines.lineStyles show the styles, while pyplot‘s linestyle attribute changes the lines graphically.

? Tidbits

  • You can also style the lines using markers, width, and colors. For example, you can mark the accountants‘ plot using o as follows.
from matplotlib import pyplot as plt ages = [20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
accountants = [40000, 41500, 42000, 42508, 43001, 44555, 46979, 48050, 49991, 51000]
plt.plot(ages, accountants, label='accountants', marker='o')
plt.show()

Output:


  • You can increase the width of the designers plot from 1 to 3 as follows
from matplotlib import pyplot as plt ages = [20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
designers = [45893, 50375, 52000, 52009, 54000, 55555, 56979, 57040, 55991, 54000]
plt.plot(ages, designers, label='designers', linestyle='-.', linewidth=3)
plt.show()

Output:


  • Lastly you can customize the plot colors using the color aliases, hex colors or names.
from matplotlib import pyplot as plt ages = [20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
designers = [45893, 50375, 52000, 52009, 54000, 55555, 56979, 57040, 55991, 54000]
developers = [55893, 53375, 52000, 51008, 58000, 58555, 59979, 60050, 65991, 67000]
accountants = [40000, 41500, 42000, 42508, 43001, 44555, 46979, 48050, 49991, 51000]
plt.plot(ages, designers, label='designers', linestyle='-.', color='b')
plt.plot(ages, developers, label='developers', linestyle=':', linewidth=3, color='#6dee6d')
plt.plot(ages, accountants, label='accountants', marker='o', color='gold')
plt.show()

Output:


Conclusion


You can get a list of styles in matplotlib using the lines attribute. After storing the target styles, you can change the lines’ appearance using pyplot‘s built-in linestyle attribute. Additionally, as illustrated in this tutorial, you can differentiate lines using markers, width, and colors.

Recommended: Matplotlib — A Simple Guide with Videos

Please stay tuned and subscribe for more interesting discussions in the future. Happy learning!



https://www.sickgaming.net/blog/2022/03/...atplotlib/

Print this item

  [Oracle Blog] Oracle JDK Releases for Java 11 and Later
Posted by: xSicKxBot - 03-28-2022, 07:29 AM - Forum: Java Language, JVM, and the JRE - No Replies

Oracle JDK Releases for Java 11 and Later

Exec Summary Starting with Java 11, Oracle will provide JDK releases under the open source GNU General Public License v2, with the Classpath Exception (GPLv2+CPE), and under a commercial license for those using the Oracle JDK as part of an Oracle product or service, or who do not wish to use open so...

https://blogs.oracle.com/java/post/oracl...-and-later

Print this item

  [Tut] PHP session time set unset and check existence
Posted by: xSicKxBot - 03-28-2022, 07:29 AM - Forum: PHP Development - No Replies

PHP session time set unset and check existence

by Vincy. Last modified on November 21st, 2021.

PHP session is one of the methods for keeping data persistency on the server side.

PHP sessions have a deadline time limit for keeping data persistent. PHP configuration file includes directives to have this specification.

We can also create custom code to change the default PHP session deadline.

This article contains sections that describe the PHP sessions, their time-limit configurations. It provides examples for setting session limits and tracking existence.

The below example gives a quick solution to set PHP session time. It contains only two steps to set and track the session expiration status.

Quick example


1. Create a file set-session.php and set value and lifetime.


<?php
session_start();
//Set PHP session with value, time
$currentTime = time();
$_SESSION['color'] = array( "value" => "blue", "time" => $currentTime, "life_time" => 5
);
?>

2. Create a file check-session.php to compute if the session existence.


<?php
session_start();
if (isset($_SESSION['color'])) { $sessionSetTime = $_SESSION['color']['time']; $sessionLifeTime = $_SESSION['color']['life_time']; if ((time() - $sessionSetTime) > $sessionLifeTime) { unset($_SESSION['color']); print 'Session expired'; }
}
?>

About PHP session


We have already seen PHP sessions and cookies in a previous article. PHP sessions are for managing application data, state persistent during the working flow.

There are a lot of uses of sessions in an application. The below list shows some of the states or data managed by the use of sessions.

We have seen how to create a login script using the PHP session. In that, the session lifetime tracking can be used to log out after few minutes of inactivity.

php session

PHP session lifetime settings


This section describes the configuration directives used to set PHP session time. The below table shows two PHP.ini settings related to the session.

PHP directive Description
session.gc_maxlifetime It sets the max lifetime after which the session will be elapsed and collected as garbage.
session.cookie_lifetime It sets the time limit for the session cookie in seconds. Default is 0 which means to be persistent until the client quits. Note: PHP session_set_cookie_params() sets all the session cookie parameters in runtime.

The below PHP info highlights the session configuration settings. Refer to more runtime session configuration directives in the linked official site.

php session settings

Example: Working with PHP session time – Set expiration and limit lifetime


This PHP session time handling example is the enhanced version of the above quick example.

It creates three session variables to set color, shape and size. It sets the lifetime for each PHP session variable while setting values.

The PHP code checks if the session exists. Once the time is reached, it unset that particular session variable and destroys it.

php session time files

Landing page to set session


The landing page of this example shows a control to set the PHP session time. Once started, the session expiration status is checked at a periodic interval. This page includes the AJAX script to raise the call to PHP to check the session.

If the PHP session time is over, then this page will display a notice to the user. After all the sessions are expired, then the page will clear the notification and ask to reset the session.

index.php


<html>
<head>
<link href="./assets/css/style.css" rel="stylesheet" type="text/css" />
</head>
<body> <div class="session" data-status='<?php if(!empty($_GET["status"])) { echo $_GET["status"]; } ?>'> <div id="box"> <h1 align="center">Set PHP session time</h1> <div class="text"> <a href="set-session.php" class="btn">Reset Session</a> </div> <div id="status"></div> </div> <div id="message"></div> </div> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script src="./assets/js/session.js"></script>
</body>
</html>

Check PHP session time via JavaScript AJAX


This script sets an interval to call the AJAX script to check the PHP session time. After getting the response, this AJAX success block shows the expired PHP sessions.

It checks the PHP session time every 5 seconds via AJAX. This script uses JavaScript setInterval() to invoke the checkSession() method.

session.js


if($('.session').data('status') != "") { var interval; interval=setInterval(checkSession, 5000); $("#status").text("Checking session expiration status...");
}
function checkSession(){ $.ajax({ url:"check-session.php", method:"POST", success:function(response){ if(response!=""){ if(response == -1){ $("#status").hide(); clearInterval(interval); window.location.href='index.php'; } else{ $("#message").append(response); } } } });
};

Set unset PHP session time


In this section, it shows two PHP files to set and unset the PHP session time.

The set-session.php is called on clicking the UI control on the landing page. It sets the color, shape and size in the PHP session.

Each session array is a multi-dimensional associative array. It has the details of PHP session set time, lifetime and value.

The session set-time and lifetime are used to calculate the session expiry.

set-session.php


<?php
if (! isset($_SESSION)) { session_start();
}
$currentTime = time();
$_SESSION['color'] = array( "value" => "blue", "time" => $currentTime, "lifetime" => 3
);
$_SESSION['shape'] = array( "value" => "circle", "time" => $currentTime, "lifetime" => 5
);
$_SESSION['size'] = array( "value" => "big", "time" => $currentTime, "lifetime" => 10
);
header("Location: index.php?status=starts");
exit();
?>

This code returns the response text once the session is expired.

It validates the session expiry by comparing the remaining time and the PHP session lifetime.

Once all three sessions are expired, then this code returns -1. On receiving -1, the AJAX callback stops tracking by clearing the interval.

check-session.php


<?php
if (! isset($_SESSION)) { session_start();
} if (! isset($_SESSION['color']) && (! isset($_SESSION['shape'])) && (! isset($_SESSION['size']))) { print - 1;
}
if (isset($_SESSION['color'])) { $sessionTimeColor = $_SESSION['color']['time']; $sessionLifeTimeColor = $_SESSION['color']['lifetime']; if ((time() - $sessionTimeColor) > $sessionLifeTimeColor) { unset($_SESSION['color']); print '<div class="response-text"><span>Color Session Expired</span></div>'; } } if (isset($_SESSION['shape'])) { $sessionTimeShape = $_SESSION['shape']['time']; $sessionLifeTimeShape = $_SESSION['shape']['lifetime']; if ((time() - $sessionTimeShape) > $sessionLifeTimeShape) { unset($_SESSION['shape']); print '<div class="response-text"><span>Shape Session Expired</span></div>'; } } if (isset($_SESSION['size'])) { $sessionTimeSize = $_SESSION['size']['time']; $sessionLifeTimeSize = $_SESSION['size']['lifetime']; if ((time() - $sessionTimeSize) > $sessionLifeTimeSize) { unset($_SESSION['size']); print '<div class="response-text"><span>Size Session Expired</span></div>'; }
}
exit();
?>

Conclusion


Thus we have learned how to set PHP session time via programming. This article described the PHP configurations to set max session lifetime.

I hope this example helped to create your own code to manage PHP sessions and time.
Download

↑ Back to Top



https://www.sickgaming.net/blog/2021/10/...existence/

Print this item

  (Indie Deal) Force Energy Bundle, Metal Gear, HITMAN, Handy Sales
Posted by: xSicKxBot - 03-28-2022, 07:29 AM - Forum: Deals or Specials - No Replies

Force Energy Bundle, Metal Gear, HITMAN, Handy Sales

Force Energy Bundle | 6 Steam Games | 94% OFF
[www.indiegala.com]
Get energized, accelerate and move forward through the day with force, enthusiasm and a powerful indie selection of 6 video games on Steam.

Konami, Handy, PQube, IO Interactive Games Sales
[www.indiegala.com]
[www.indiegala.com]
[www.indiegala.com]
[www.indiegala.com]

Stay Inside, Stay Safe and Enjoy Good Games.
Check out IndieGala on Twitter, YouTube & Facebook[www.facebook.com]


https://steamcommunity.com/groups/indieg...0012079770

Print this item

  (Free Game Key) In Sound Mind - Free Epic Game
Posted by: xSicKxBot - 03-28-2022, 07:29 AM - Forum: Deals or Specials - No Replies

In Sound Mind - Free Epic Game

Visit the store page and add the game to your account:

In Sound Mind[store.epicgames.com]

The game is free to keep until Mar 24th 2022 - 15:00 UTC.

Next week's freebie:
DEMON'S TILT

We are welcoming everyone to join our discord[discord.gg]. We are more active there on finding giveaways, small or large, and there are daily raffles you can participate.

?GrabFreeGames.com ?Twitter ?Steam Curator ?Facebook[fb.me]?Discord[discord.gg]
❤️Support us: ✔️HumbleBundle Partner[www.humblebundle.com] Epic Tag: GrabFreeGames


https://steamcommunity.com/groups/GrabFr...9634087998

Print this item

 
Latest Threads
Black Ops 2 GSC Studio | ...
Last Post: hotswagonme
6 minutes ago
Apollo Neuro Discount Cod...
Last Post: AmmYChoudhary1
24 minutes ago
Apollo Neuro Discount Cod...
Last Post: AmmYChoudhary1
25 minutes ago
Apollo Neuro Coupon Code ...
Last Post: AmmYChoudhary1
27 minutes ago
Apollo Neuro Coupon Code ...
Last Post: AmmYChoudhary1
29 minutes ago
Apollo Neuro Coupon Code ...
Last Post: AmmYChoudhary1
30 minutes ago
Apollo Neuro Coupon Code ...
Last Post: AmmYChoudhary1
32 minutes ago
Apollo Neuro Coupon Code ...
Last Post: AmmYChoudhary1
34 minutes ago
Apollo Neuro Discount Cod...
Last Post: AmmYChoudhary1
38 minutes ago
Black Ops 2 Jiggy v4.3 PC...
Last Post: MrEzlo
56 minutes ago

Forum software by © MyBB Theme © iAndrew 2016