Jump to content

cjb

Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Posts posted by cjb

  1. This will display every Friday of the current month, use the array $fridays for the unix time.  Let me know if you have any questions.

     

    $now = time();
    $nowYear = date('Y', $now);
    $nowMonth = date('n', $now);
    $nowDay = date('j', $now);
    $uFirstDay = mktime(0,0,0,$nowMonth,1,$nowYear);
    $uLastDay = mktime(0,0,0,$nowMonth+1, 0, $nowYear);
    $firstDay = date('D', $uFirstDay);
    
    $fridays = array();
    $fridaysCount = 0;
    $day = $uFirstDay;
    while($day <= $uLastDay){
    	$weekday = date('D', $day);
    	if($weekday == "Fri"){
    		$fridays[$fridaysCount] = $day;
    		echo date('D, M j, Y', $day) . "<br>";
    		$fridaysCount++;
    	}
    	$day = $day + (60*60*24);
    }	
    
    echo "<br><br>There are $fridaysCount Fridays this month<br>$fridays[0],$fridays[1],$fridays[2],$fridays[3]";

  2. I have a db of functions that are called on a certain criteria. I am trying to get those from the db to be called in a page. I try to [code]echo $function[/code] but all that happens is it prints the text out instead of calling the function 'function();'.

    Is there some other way to echo the text function(); from a db other than using 'echo'?
  3. Thanks for the tutorial.

    It suggest that you change any blog data types to text making it searchable. Does this mean you cannot search binary data? The only downfall of using text compared to longblob is the maximum length. I have large files to store in the DB and I don't think text will be enough.

    Any other suggestions?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.