Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6196817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:42:29+00:00 2026-05-24T03:42:29+00:00

lib.php: <?php function get_time() { loop = true; while (loop) { echo date(F j,

  • 0

lib.php:

<?php

function get_time() {
    loop = true;
    while (loop) {
        echo date("F j, Y, g:i a");
    }
}

?>

index.php contains this:

<?php
    include("lib.php");
?>

and this somewhere further down:

<?php
    get_time();
?>

However, I don’t see anything.

So I see two potential problems here. Either I need to declare the include() at the same time as I declare the function. Or PHP is unable to display continuous data (like in the case of this while loop) on a webpage without refreshing.

If it’s the former, is there a way to declare the include() globally for my whole page? If it’s the latter, how can I get it to show the contents of a continuous loop on my page? Will I have to use another language? Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T03:42:30+00:00Added an answer on May 24, 2026 at 3:42 am

    This piece of code will loop infinitely:

    function get_time() {
        loop = true;
        while (loop) {
            echo date("F j, Y, g:i a");
        }
    }
    
    get_time();
    

    So the fact that you do not see anything is probably because of this.

    Also, you are correct – to see continuously updated data like this, you either need to be refreshing the page, or update the content through AJAX calls.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's assume we have the following structure: index.php config.inc.php \ lib \ lib \
I get the following error messages: Warning: include_once(Zend\Db.php) [function.include-once]: failed to open stream: No
Here is my index.php in this suppose i am calling the command getresellers it
Getting this error: Fatal error: require_once() [function.require]: Failed opening required 'db/db.php' (include_path='/home/domain.ru/testerier/sites/application/../library:/home/domain.ru/testerier/sites/library:.:/usr/local/lib/php;/home/domain.ru/testerier/sites/application/models') in /home/domain.ru/testerier/sites/www/index.php
in /lib/Helper.class.php: class Helper { //... some functions static public function createImage( $src_image, $params)
I am doing the following in PHP: exec('java -jar /opt/flex3/lib/mxmlc.jar +flexlib /opt/flex3/frameworks MyAS3App.as -default-size
I have .lib file with its header (.h) file. This file have a few
I installed the Mail_Mime package. include('Mail.php'); include('Mail/mime.php'); I get the following errors: Warning: include(Mail.php)
This is the portion of code surrounding the issue function twitter_count($twitter_id, $widget_id, $clear_cache) {
I'm using this string to validate a date field in dd/mm/yyyy' and 'dd-mm-yyyy format:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.