How Can I Get First Date Of Present Week Using PHP

admin_img Posted By Bajarangi soft , Posted On 27-11-2020

Using strtotime() function we can get the first day of week.This function returns the default time variable timestamp and then use date() function to convert timestamp date into understandable date and returns the result in timestamp by parsing the time string.So today we implement php code for it.

How Can I Get First Date Of Present Week Using PHP

Complete Code For Getting First Date Of Present Week Using PHP.

<!DOCTYPE html>
<html>
<head>
    <title>How Can I Get First Date Of Present Week Using PHP</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet">
</head>
<style>
    body {
        background: black;
    }
</style>
<body>
<body>
<div class="container">
    <br/><br/>
    <div class="text-center">
        <h1 id="color" style="color: white;">Get First Date Of Present Week Using PHP</h1>
    </div>

    <div class="well">
        <?php
        
            $firstday = date('l - d/m/Y', strtotime("this week"));

            echo "First day of this week: ", $firstday;

        ?>
    </div>
</div>
</body>
</html>

Related Post