PHP Testing

testing.thumbnail

PHP Testing >>

The main problem i faced during php programming the lack of quick testing.
For Example if i want to test the function substr(), how this is working, or
what is the result of file_get_contents function, or sometimes we see new php
functions from different websites. If you wanna test , you write php code on
file and save as php file and put into your web root and check via browsers.

But there is a simple way to test php functions from shell or a command line
(cmd) . What you want to do is, add the path of your php.exe in your shell/
cmd PATH variable. After that type

php -a

from command line or shell, you will get php in interactive
mode. Just type your php codes and see the result on time. No need to use a
browser or webserver to check your php code.

E:\Rework\mobshare>php
-a
Interactive mode enabled

<?php
echo ‘hai’;
hai

for($i=0;$i<10;$i++)
{
echo $i.’<br>’;
}
0<br>1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>

0 Comments

No comments yet.

Leave a Reply

More in php (90 of 101 articles)


PHP Dynamic Variable >> _____________________ $sajith = 'kenney' ; $kenney = 110 ; echo $$sajith ; //will give an ...