https://github.com/AJRepo/PHPlot
Tag Archives: PHP
[php] september 23 2011
PHP Code die(‘Could not connect: ‘ . mysql_error()); Code Dissection 1. die() — A PHP Function. The die() function prints a message and exits the current script. 2. mysql_error() — A PHP function. The mysql_error() function returns the error description of the last MySQL operation.
division using PHP
division #!/usr/bin/php # Author : Jeffrin # jeffrin@rocketmail.com # License GNU GPL V3 # usage : php subtraction.php <?php $f=’1′; $s=’1′; echo $f – $s ; echo “\n”; ?> output Like $./divide.php # Author : Jeffrin # jeffrin@rocketmail.com # License GNU GPL V3 # usage : php divide.php 1 $
addition. using PHP
addition #!/usr/bin/php # Author : Jeffrin # jeffrin@rocketmail.com # License GNU GPL V3 # usage : php addition.php <?php $f=’1′; $s=’1′; echo $f + $s ; echo “\n”; ?> A Screenshot $./addition.php # Author : Jeffrin # jeffrin@rocketmail.com # License GNU GPL V3 # usage : php addition.php 2 $
files.3
ahiliation:~$cat workethics.php ahiliation:~$php workethics.php The text has been savedahiliation:~$ ahiliation:~$cat workethics.txt Work ethics in QA Fashionahiliation:~$ http://www.phptutorial.info/learn/OpenReadCreate-files.php
files. 1
$ourFileName = “workethics.txt”; $ourFileHandle = fopen($ourFileName, ‘w’) or die(“can’t open file”); fclose($ourFileHandle); http://www.tizag.com/phpT/filecreate.php ahiliation:~$php -r workethics.php Parse error: syntax error, unexpected $end in Command line code on line 1 ahiliation:~$