सप्ताह के पहले दिन को PHP में प्राप्त करने के लिए, कोड इस प्रकार है -
उदाहरण
<?php
$res = date('l - d/m/Y', strtotime("this week"));
echo "First day = ", $res;
?> आउटपुट
यह निम्नलिखित आउटपुट देगा -
First day = Monday - 09/12/2019
उदाहरण
आइए अब एक और उदाहरण देखें -
<?php
echo "Displaying Sunday as first day of a week...\n";
$res = date('l - d/m/Y', strtotime("sunday 0 week"));
echo "First day (next week) = ", $res;
?> आउटपुट
यह निम्नलिखित आउटपुट देगा -
Displaying Sunday as first day of a week... First day (next week) = Sunday - 15/12/2019