Location: PHPKode > scripts > A Simple Sloganizer > a-simple-sloganizer/sloganizer.class.php
<?php
class sloganizer
{
	var $sloganFile;
	var $keywordGot;
	
	function sloganizer($keywordSent)
	{
		$this->sloganFile=file_get_contents('slogans.txt');
		$this->keywordGot=$keywordSent;
	}
	
	function makeSlogan()
	{
		$allSlogans=explode(';',$this->sloganFile);
		
		for($i=0;$i<count($allSlogans)-1;$i++)
			$noNullSlogan[$i]=$allSlogans[$i];
			
		shuffle($noNullSlogan);
		
		$randSlogan=$noNullSlogan[0];
		        $randSlogan=str_replace('1234',$this->keywordGot,$randSlogan);
		
		return $randSlogan;
	}
}
?>
Return current item: A Simple Sloganizer