Saturday, February 26, 2011

Introduction to String function PHP(part 1)

Assalamu'alaikum and selamat sejahtera

Here is the example of String function in PHP
----->TRY IT!<----------

chr()


$email = "nuar" . chr(64) . "Email.com";
print $email;

ord()


$asciiNumber= ord("%");
print $asciiNumber

echo()


$Alternativedisplay = "the other option to display";
print $Alternativedisplay;
echo $Alternativedisplay;

similar_text()

$real_name ="John lennon";
$guess_name = "John lenon";

$check_answer = similar_text($real_name, $guess_name, $percentCorrect);
print($check_answer) . "<BR>";
print($percentCorrect . "% correct");


//tell the accuracy of $guess_name as compare to $real name in percentage 
 
str_repeat()

$extra_alias = str_repeat("@", 5);
print $extra_alias;


click here for more on ASCII number 
 

No comments:

Post a Comment