Showing posts with label php tutorial. Show all posts
Showing posts with label php tutorial. Show all posts

Thursday, 11 December 2014

Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\excel-to-mysql-using-php\index.php on line 34

Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\excel-to-mysql-using-php\index.php on line 34


i>Open your xampp.
ii>Go to Apache config.
iii>Select php.ini file.
iv>Make these changes.


max_execution_time = 360         ; Maximum execution time of each script, in                                                      seconds 
max_input_time =   120              ; Maximum amount of time each script may                                                 spend parsing request data
max_input_nesting_level = 64      ; Maximum input variable nesting level
memory_limit = 128M                  ; Maximum amount of memory a script may                                                  consume (128MB by default)

v>Restart your Apache.

Monday, 8 December 2014

swapping of two variables's value in php

swapping of two variables's value in php


<?php

$a=7;
$b=9;
list($a,$b)=array($b,$a);
print $a;
print $b;

?>


Alternate:

<?php
$a=7;
$b=9;
$a=$a+$b; //$a= 7+9 = 16
$b=$a-$b;  //$b= 16-9 = 7
$a=$a-$b;   //$a=  16-




?>

printing a star pattern in php

printing a star pattern in php



i>                <?php                                                       output: 
             
                   for($i=1;$i<=5;$i++)                                 *
                {                                                                  *
                   echo  "x \n";                                               *
                 }                                                                  *
                                                                                     *
                    ?>

 ii>
                <?php                                                       output:
                                                         
        for($i=1;$i<=5:$i++)                                            *****
        {                                                                          *****
           for($j=1;$j<=5;$j++)                                        *****
              {                                                                    *****
                                                                                    *****
         echo "x ";
             }

           echo "\n";
             }

    ?>

iii>

  <?php                                                                     output:
                                                         
        for($i=1;$i<=5:$i++)                                            *
        {                                                                          **
           for($j=1;$j<=$i;$j++)                                        ***
              {                                                                    ****
                                                                                    *****
         echo "x ";
             }

           echo "\n";
             }

    ?>

iv>
  <?php                                                                       output:
                                                         
        for($i=1;$i<=5:$i++)                                            *****
        {                                                                          *****
           for($j=1;$j<=5;$j++)                                        *****
              {                                                                    *****
                                                                                    *****
         echo "x ";
             }

           echo "\n";
             }

   v>

  <?php                                                                     output:
                                                         
        for($i=1;$i<=5:$i++)                                            *****
        {                                                                          ****
           for($j=1;$j<6-$i;$j++)                                       ***
              {                                                                    **
                                                                                    *
         echo "x ";
             }

           echo "\n";
             }

    ?>

vi>

  <?php                                                                     output:
                                                         
        for($i=1;$i<=5:$i++)                                           *
        {                                                                         **
           for($j=1;$j<=(4i>3? 6-$i:$i);$j++)                   ***
              {                                                                   **
                                                                                   *
         echo "x ";
             }

           echo "\n";
             }

    ?>