To install PHP5 and Apache2 manually in UBUNTU 12.04 you need to run the following command. sudo apt-get install php5 sudo apt-get install apache2 It will start installing apache2 and PHP5 for your UBUNTU.
Tag: PHP
Object Oriented Programming in PHP is MUST to be a PHP programmer. See the following simple OOP Snippet written in PHP <?php /** * @author Shaharia Azam * @link http://www.shahariaazam.com * @description This simple class will return your next number. In this example the myNextNumber method will * return yourGivenNumber + 2. Because in class constructor you declared each time you will run myNextNumber method * it will return with +2. This is just for a simple OOP snippet to …
Sometimes we need to check whether any specific server are up or down. It’s sometimes so much important. So that I have prepared the following code snippet which will tell you about the server whether it is down or up. I have used fSockOpen in this case to test it. so the function I have created is <?php /** * @param null $host * @param null $port * @param null $timeout * @return bool|string */ function PingToServer($host=null, $port=null, $timeout=null) { …
__toString magic method in PHP OOP is a very good stuff to covert your object into string. Let’s write some code without __toString(). <?php class LearnToString{ public $WhatIsToString; function __construct($WhatIsToString){ $this->WhatIsToString=$WhatIsToString; } } $obj=new LearnToString('hello world'); echo $obj; ?> Now if you want to see the result then you must see the following error like it says. Warning (4096): Object of class LearnToString could not be converted to string [YourFileName.php, line 11] Yes, if you are a PHP OOP learner …
Suppose you have a date  2012-12-20 and today is 2012-12-18. What’s the different You can now see the ‘Time Remaining to 2012-12-18’ by implementing the following code. Now you can use TimeAfter() with all your required arguments. To get PHP current date time you can use <?php echo date(‘Y-m-d’); ?> To compare with the previous date you can use <?php echo $YourDateValue; ?> To get simple format you can use the function as follows:$remaining= TimeAfter(date('Y-m-d'),'2012-12-18',true,array('before'=>'after ')) Argument List respectively: …