Ausrechnen von Minuten Sekunden... mit unixtime und timestamp

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Parse error: parse error, unexpected T_VARIABLE

    PHP Code:
    ${timeresult$i} = calcDiff($zeit, ${time$i}); 

    Comment


    • #17
      PHP Code:
      ${timeresult.$i} = calcDiff($zeit, ${time.$i}); 
      Aber du darfst gern auch mal selber denken (oder auf http://php.net/manual nachschauen)!

      Comment


      • #18
        Notice: Use of undefined constant timeresult - assumed 'timeresult' in /var/www/test4.php on line 72

        Notice: Use of undefined constant time - assumed 'time' in /var/www/test4.php on line 72

        Notice: Undefined variable: time1 in /var/www/test4.php on line 72


        PHP Code:
        ${timeresult.$i} = calcDiff($zeit, ${time.$i}); 
        kommt sowas nicht immer wenn Strings nicht gequotet sind ? oder so ?

        Comment


        • #19
          Das meine ich mit selber denken ...

          Comment


          • #20
            habe ich trotzdem scheint an deinen code was falsch zu sein
            oder ich mache einen fehler weil



            Undefined variable: time1
            ....
            Undefined variable: time10

            PHP Code:
            function calcDiff($zeit$time) {
                
            $timediff $zeit $time;
                
            $y intval($timediff 31536000);
                
            $remain $timediff 31536000;
                
            $m intval($remain 2628000);
                
            $remain $timediff 2628000;
                
            $d intval($remain 86400);
                
            $remain $timediff 86400;
                
            $h intval($remain 3600);
                
            $remain $remain 3600;
                
            $i intval($remain 60);
                
            $s $remain 60;






            return (
            $y "$y<font color=\"#FF9900\">y</font>" '')
                  .(
            $m "$m<font color=\"#FF9900\">m</font>&nbsp;" '')
                  .(
            $d "$d<font color=\"#FF9900\">d</font>&nbsp;" '')
                  .(
            $h "$h<font color=\"#FF9900\">h</font>&nbsp;" '')
                  .(
            $i "$i<font color=\"#FF9900\">m</font>&nbsp;" '')
                  .
            "$s<font color=\"#FF9900\">s</font>";


            }
            for (
            $i 1$i <= 10$i++) {
            ${
            'timeresult'.$i} = calcDiff($zeit, ${'time'.$i});

            Comment

            Working...
            X