how to retrieve from database..... this format (PRMRMDU402).
firstname= prabhu, lastname=kumar, city=madurai,
pincode=624402....
i want first name first two letters and last name last two
letters ... city first two letters ... pin code last three
letters....
Answer Posted / gaurav
$record = mysql_fetch_array(".........");
$fn = substr($record['firstname'], 0, 2);
$ln = substr($record['lastname'], -2);
$ct = substr($record['city'], 0, 2);
$pc = substr($record['pincode'], -2);
$final = strtoupper($fn.$ln.$ct.$pc);
echo $final;
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
How to remove duplicate values from php array?
Difference between get and post method.
What is the difference between static and dynamic websites?
Why do we use htaccess and where?
How can you get web browser’s details using PHP?
What is php default argument?
What is pdo in php why use?
How error handling is being handled by php?
How do you sort an array in php?
What is the difference between echo, print and printf()?
What is php regular expression?
What should be the length of variable for SHA256?
How does firefox manage cookies?
What is foreach loop in php?
Maine 12th ke bad 2 years ka web designing ka course kiya hai. Php me achcha hu. Ek fresher ko is field me kitna mil sakta hai ?