For Subtract 1 week use this code:
Please replace your date with ‘2012-12-12‘.
$first_date = strtotime('2012-12-12'); $second_date = strtotime('-7 day', $first_date); print 'First Date ' . date('Y-m-d', $first_date); print 'Next Date ' . date('Y-m-d', $second_date);
You Can Also Use This Code for Subtract 1 Week:
Please replace your date with ‘2012-12-12‘.
echo date('Y-m-d', strtotime('-7 day', strtotime('2012-12-12')));
Related Posts:
- How can I send an email using PHP?
- What’s the best way to use the Featured Image for responsive web design?
- Create WordPress pages with PHP
- Load post content into iframe
- wp_customize_image_control default value
- Passing JSON data from WP Query into AJAX causing NULL errors
- Get post meta in enqueued js file
- How to make sure that only one wp_cron() runs at a time?
- How to Remove a Filter from the Admin List Table?
- Specific Loop For 2 Within Each
- How to add specific menu on a specific page or pages
- Widgets not showing in my custom theme
- How to return output of the new wp gallery block for automatically Link images To Media file
- Is it necessary to upgrade to php7? [closed]
- Asking popup for delete post in WordPress [closed]
- Extract subdomain and relative address from a url
- Adding a div at the bottom of a sidebar
- APC 500 Internal server error [closed]
- WordPress to end support for PHP 4?
- How do I let users upload files to a chosen location?
- Creating a Multi-Level Associative Object Using AJAX
- PHP Fatal error: Out of memory in WordPress [closed]
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- Return a numerical function value in Customizer controls
- Passing UTM Parameters To Modify Page In WordPress
- Find exactly what php files are responsible for each php process
- WordPress Multiple Navigation bars
- Scrape external webpage for first image and add it to new post
- how to test for all children (including multilevel grand-childern) of page
- Only first shortcode gets executed
- How to obtain the current website URL in my theme?
- Read array in php?
- anyway to put inside a $outprint=sprintf()
- Can’t save php string to a custom field
- Search form does not work in my website
- stripping tags from excerpt in WordPress is not working
- meta box not display data input in the textarea
- How to modify the default feed via a function
- How to pass a variable into an add_filter() function?
- Code snippet to show current php version inside “At a Glance” box in admin
- How to disable send e-mail notification new comments for some posts
- How to override url params with rewrite rules vars?
- Undefined offset: 3 in custom function
- Redirecting to a custom forgot password page
- Website completely messes up when logging out
- Searching Posts Programmatically in a WordPress Plugin
- How to edit the styles for the table of pages/post listed in the admin when you click on pages/posts?
- add the value of a variable returned in a while loop [closed]
- How to make blog post entries appear as input form instead of just text?
- Taxonomy term count
- using images in next/previous_post_link [closed]
- Drupal is going Symfony. Would WordPress benefit from doing the same? [closed]
- how to show images without passing it to timthumb.php file for resizing
- search.php to search only the post title
- How to redirect outgoing links via my own website
- Unset all main menu items except those with $menu_object->title == ‘x’
- Display Visual Composer shortcode if a post belongs in specific categories
- Add Featured Image to Existing Post
- How can I prevent a shortcode div from extending beyond its boundaries?
- Woocommerce Product page add on checkbox and price
- Where Do Image Dimensions Get Added To A Filename?
- Get custom field value from the function.php
- WP_QUERY post_in problem
- custom taxonomies not working
- Change WooCommerce currency programmatically on AJAX request
- Trying to add get_the_title hook to this line
- Comparing Dates within plugin using PHP If statement
- Clone the “proceed to cart” button and place it above checkout on the cart page, but only appear display size is 320px
- Add Alt attribute to image served with php
- how to check if the post id has a new comment?
- Only Get A Certain Number of Posts From WP_Query
- Even with PHP plugin get_posts not working in widget area
- extract url from a hyperlinked string in PHP [closed]
- Published custom posts missing
- Not logged in when using http
- Why isn’t my link attribute getting my css?
- How to get values from wordpress listings and use them in javascript array?
- Merge / Combine two php functions for Previous and Next Link with Thumbnail
- Repeatable field within repeatable group of fields
- str_replace not responding in functions.php [closed]
- How to get WordPress Adminmenu items?
- Banner editable from backend
- Add Custom Post Type on the Fly or create an array
- How to set up and use a custom upload directory for post type ‘product’
- WordPress article with 50 000 words loading slow – 100% cpu
- WordPress WP_Query() Not working properly
- Parse error: syntax error, unexpected ‘echo’ (T_ECHO) in C:\xampp\htdocs\AttendanceSystem\resources\php\method.php on line 250 [closed]
- Error in php code
- Check if username doesn’t exists
- Show wrapper divs if query has results, then loop the results [closed]
- How make wp_nav() with my css?
- How to implement a custom sliding banner? [closed]
- Pull latest Youtube Video from json url and make new post
- WooCommerce Checkout Cart [closed]
- How can I get values from a custom post type depending on where I click on my SVG map?
- Woocommerce – add tracking code to another email template
- How to add custom user role into wordpress
- change title of page dynamically
- Custom Filtering date with newsletter
- Custom plugin doesn’t show in admin menu – when code added, displays an empty page