Jump to content

nudo01

New Members
  • Posts

    3
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

nudo01's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. So, my problem is that I need to edit my Xmas calculator to understand when this year's Xmas is over, it will automatically jump to the next one (2011-12-25). I have no idea how to do this (noob to php...) Thanks in advance. Here's my code: <?php $time=time(); $xmas=strtotime("2010-12-25 00:00:00"); $diff = $xmas - $time; $days=intval($diff/86400); $left=$diff%86400; $hs=intval($left/3600); $left=$left%3600; $mins=intval($left/60); $secs=$left%60; echo "<font size=12 face=corbel> Xmas is after:<br> <strong>$days days</strong><br> <strong>$hs hours</strong><br> <strong>$mins mins $secs secs</strong>! </font>"; ?>
  2. Hi guys! I really need your help... :'( I'm new to PHP and I need to make a code like this: List of towns (names both finnish and swedish) and their town codes. I've made it this far. <?php $a = file_get_contents("suomi.txt"); //hakee datan $b = file_get_contents("ruotsi.txt"); $a = str_replace(array("\r\n" , "\t") , array("[uusi rivi]" , "[tab]") , $a); //määrittää rivinvaihdon ja tabin $b = str_replace(array("\r\n", "\t") , array("[uusi rivi1]", "[tab1]"), $b); foreach( explode("[uusi rivi]" , $a) as $viivat) { //looppaa "suomi.txt" print "<tr>"; foreach( explode("[tab]" , $viivat) as $lista) { print "<td>"; print $lista; print "</td>"; } } print "</tr>"; ?> So I need another loop code that doesn't import town codes, only swedish names. I have to use functions like intval, is_numeric etc but I can't understand any of the manuals. Thank you. [attachment deleted by admin]
×
×
  • 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.