Same script, but work in some server and doesn't work in some server.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wesley1970
    New Member
    • Nov 2007
    • 15

    Same script, but work in some server and doesn't work in some server.

    [PHP]<?php

    $range = split(',', '2008-11-1>2008-11-30=123,2008-12-1>2008-12-31=222,');
    for ($y=0; $y<(count($rang e)-1); $y++){
    $equalto = explode('=',$ra nge[$y]);
    $splitagain = split('>',$equa lto[0]);
    for ($s=strtotime($ splitagain[0]); $s<(strtotime($ splitagain[1])+10); $s=$s+(60*60*24 ))
    {
    $money[$s]=$equalto[1];

    }

    }

    $kk = $money[1225497600]; //1225497600 is the time stamp within the for loop
    if ($kk==''){echo 'what happen??';}
    else {echo $kk;}
    ?>[/PHP]


    it is the server it works http://kamchihau.meibu.com/testcalender.php

    however in this server it goes. http://www.yagit.com.hk/testcalender.php
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    split() should be used with regular expressions.

    split

    (PHP 4, PHP 5)

    split — Split string into array by regular expression

    Comment

    • hsriat
      Recognized Expert Top Contributor
      • Jan 2008
      • 1653

      #3
      Use explode instead.

      Comment

      • wesley1970
        New Member
        • Nov 2007
        • 15

        #4
        I know the reason......... ... Time Zone........... ... i guess i have to rewrite the program........ .. thankssssss...

        Comment

        Working...