There are 18 items you can search

Last Updated Badge Script | VibeScriptz

A lightweight PHP script for showing when a page or file was last updated.

This lightweight PHP script shows a simple Last updated line based on the modified time of a file. It is useful for blogs, tools, static pages, documentation, and script examples where visitors may want to know how fresh the page is.

The script uses PHP’s built-in filemtime() function, so it does not need a database, plugin, cron job, or extra dependency.

A last updated badge can make a page feel more maintained and trustworthy. It gives readers a quick freshness cue before they follow code examples, read instructions, or rely on older content.

It is also a practical way to improve content pages without adding a full editorial system. If you update the file, the badge updates automatically.

Paste this helper function into a PHP page, then echo it wherever you want the last updated line to appear.

<?php
declare(strict_types=1);

function last_updated_badge(string $filePath): string
{
    if (!is_file($filePath)) {
        return '';
    }

    $updated = date('F j, Y', filemtime($filePath));

    return '<p class="muted"><em>Last updated: '
        . htmlspecialchars($updated, ENT_QUOTES, 'UTF-8')
        . '</em></p>';
}

echo last_updated_badge(__FILE__);
?>

The script outputs a simple line like this:

<p class="muted"><em>Last updated: May 2, 2026</em></p>

You can change the date format if you want a shorter or more technical output.

<?php
$updated = date('Y-m-d', filemtime(__FILE__));

echo '<p class="muted"><em>Updated: '
    . htmlspecialchars($updated, ENT_QUOTES, 'UTF-8')
    . '</em></p>';
?>

Use this on blog posts, tool pages, script pages, documentation, changelog-style pages, tutorials, and static content that gets edited over time. It works especially well near the page title, below the intro, or at the bottom of an article.

Do not use this as a fake content freshness signal. If the file changes because of unrelated formatting, deployment, or server-side edits, the modified date may update even when the actual page content did not meaningfully change.

Use this script when you want a low-maintenance way to show visitors that a page has been edited or refreshed. It is a good fit for simple PHP sites, personal projects, resource pages, and lightweight webmaster tools.

Skip it if your site already stores publish and modified dates in a database, CMS, or structured content file. In that case, use the official content date instead of the server file modified time.