PHP is the most widely used web based programming language that powers millions of websites including some of the most popular one like Facebook. In Php we have some regular function where people use it regularly. what i thought as a web developer y can't
i share my knowledge to my readers and help them on some projects because even after using PHP for years, we stumble upon functions and features that we did not know about. Some of these can be quite useful, yet underused. as a PHP develop you should familiar with functions and features.

Find the string length
The strlen() function returns the length of a string.<?php $one="php useful functions"; echo strlen($one); ?>
Reverse the String
The strrev() function reverse a string<?php $one="php useful functions"; echo strrev($one); ?>
Return a part of a String
The substr(string, start position, limit position) function return a part of a string. the function contain 3 parameters<?php $one="php useful functions"; echo substr($one,0,5); ?>
Wrap a String
The wordwrap(string, start position, limit position) function wraps a string to a given number of characters. using break character we can wrap the string.
<?php $one="php useful functions for all php developers"; echo wordwrap($one,10,"<br/>/n"); ?>
Calculate the md5 hash string
The md5(string) function is convert the string to a special hash string. this function is use various areas like password protection and other security data.
<?php $one="php useful functions for all php developers"; echo md5($one); ?>
Coverting to clean URL
The urlencode(string) function is convert the url to clean url.
<?php $new="This is lessoncup"; $enc=urlencode($new); echo $enc; echo urldecode($enc); ?>
thank you :)
ReplyDeleteecho strre($one);
ReplyDeletecorrect this line of code
thank you... spell mistake
Deletewhy you don't write the output under every code example. this will make it more clear
ReplyDelete