Jump to content

rajivgonsalves

Members
  • Content Count

    2,166
  • Joined

  • Last visited

    Never

Community Reputation

0 Neutral

About rajivgonsalves

  • Rank
    Prolific Member
  • Birthday 07/31/1979

Contact Methods

  • MSN
    rajivgonsalves@hotmail.com
  • Website URL
    http://www.rajivgonsalves.com
  • Yahoo
    rajivgonsalves

Profile Information

  • Gender
    Male
  • Location
    Pune, India
  1. if your looking for one that checks the starting letter I think the following should do <?php function getBefore($word) { return in_array(strtolower(substr($word,0,1)), array('a','e','i','o','u')) ? 'an' : 'a'; } echo getBefore('english') . '<br />'; echo getBefore('spanish') . '<br />'; ?>
  2. Your not doing anything wrong there was a bug in the code new code below <?php function dynamicinclude($filename,$strDate,$intMax) { $intTime = strtotime($strDate); $intToday = time(); $intDifference = $intToday-$intTime; $intWeek = floor($intDifference/(86400*7)); $intCounter = $intWeek%$intMax+1; $strFilename = $filename.$intCounter.".php"; include("../includes/songs/".$strFilename); } dynamicinclude("song","2007-11-20",3); ?> lemme know if you face any problems
  3. Yes you just give a start date parameter two, if you have more files than 70 change the last parameter, so say you got 100 files put 100 there it will rotate, if your putting it in some folder just change the include statement from include($strFilename); to include("includes/".$strFilename); if all files are residing in the include folder. hope it helpful
  4. here I wrote you something <?php function dynamicinclude($filename,$strDate,$intMax) { $intTime = strtotime($strDate); $intToday = time(); $intDifference = $intToday-$intTime; $intWeek = ceil($intDifference/(86400*7)); $strFilename = $filename.($intWeek%$intMax).".php"; include($strFilename); } dynamicinclude("file","2007-12-10",70); ?> Param1 = "file" is the string so basically it will be file1.php and so on you can change it to something else Param2 = start date of the include Param3 = max number of include file so it will rotate hope its helpful
  5. currently we are running in the 50 week of the year so it will file50.php once we cross next week it will include file51.php and onwards however you can write a better include system based on a give date so that you give a date from that date until 7 days it will include file1.php...
  6. You can do <?php include("file".date("W").".php"); ?> but as per my knowlegde I think there are 52 weeks in a year
×
×
  • 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.