Advanced PHP Training

104 3

    Cookie Handling

    • In PHP, you can both create and retrieve cookie values. The setcookie() function is used to set cookies and appears before the <html> tag. The PHP$_COOKIE variable is used to retrieve cookie values.

    Ternary Operators

    • Ternary operators are alternative functions to if/else statements, and they free up line space, reducing code clutter and making it easier to debug.

    PHP Sessions

    • This involves passing along data from one webpage to another as in the case of a shopping cart. A PHP session is usually started as shown below:

      <?php

      Session_start();

      ?>

      This code comes before any HTML or text and registers a user's session with a server to begin saving user information.

Source...
Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time

Leave A Reply

Your email address will not be published.