This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$reverse = array(); | |
# Split based on space (words) | |
$words = explode(' ', 'samsung galaxy 8260'); | |
# Get the words count | |
$toProcess = count($words); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$test = 'Works!'; | |
echo $test ?: 'Not working :('; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$text = "The UPA government braces itself for the last session of the 15th Lok Sabha, hoping to persuade the Opposition to cooperate with it in clearing an ambitious legislative agenda.Six anti-corruption laws and the controversial Bills on Telangana, women’s reservation and communal violence are on the agenda, apart from two votes on account.The government’s parliamentary managers are working overtime to soften the Opposition, but the BJP has thus far made it clear that it will not pass anything unless there is order in the House."; | |
$wordCount = array_count_values(str_word_count($text, 1)); | |
asort ($wordCount); | |
echo "<pre>" . var_export($wordCount, true) . "</pre>"; | |
>? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$description = '<div class="field field-name-field-image field-type-image field-label-hidden"><div class="field-items"><div class="field-item even"><a href="/pattern/popover-tip-billionaire"><img src="http://patterntap.com/sites/default/files/styles/pattern-thumb/public/newpatterns/506f0e6a77a47.png" /></a></div></div></div><div class="field field-name-field-source field-type-link-field field-label-hidden"><div class="field-items"><div class="field-item even"><a href="http://www.billionaire.com/" target="_blank" class="source">http://www.billionaire.com/</a></div></div></div>'; | |
$dom = DOMDocument::loadHTML($description) or die("HTML parse error"); | |
$nodelist = $dom->getElementsByTagName('img'); | |
$nb = $nodelist->length; | |
for($pos=0; $pos<$nb; $pos++) { | |
$node = $nodelist->item($pos); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
print date("Y-m-d", strtotime("+0 months")).'<Br /><Br />'; | |
print date("Y-m-d", strtotime("+1 months")); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class intro { | |
public $fname; | |
public $lname; | |
public $age; | |
public $qualification; | |
public $job; | |
public $interests; | |
public $skill; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `login` ( | |
`name` VARCHAR(255), | |
`id` INT(8) NOT NULL AUTO_INCREMENT, | |
PRIMARY KEY (`id`) | |
); | |
CREATE TABLE `employee` ( | |
`eid` INT(8) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dbsetup.ini | |
========== | |
[dev] | |
DB_SERVER = "servername:port" | |
DB_NAME = "dbname" | |
DB_USER = "username" | |
DB_PASSWORD = "xxxxxxxxxxx" | |
[prod] | |
DB_SERVER = "servername:port" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define("PHP_CACHE_DIR", "./"); | |
$cd = date("m/d/Y"); | |
$cachefile = PHP_CACHE_DIR."PHP_CACHE_".md5($cd).".CHE"; | |
if (file_exists($cachefile)) { | |
include $cachefile; | |
echo "Loading from cachefile <br>"; | |
}else{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APACHE Installation | |
=================== | |
sudo yum install httpd | |
sudo service httpd start | |
Verify the Apache version | |
httpd –v | |
curl –I localhost | |
rpm –qa | grep –w httpd-[0-9] |
OlderNewer