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
Should I learn php before wordpress?
How to set a value in session? How to remove data from a session?
What is the difference between print() and echo()?
What is php variable?
What is binary safe string?
Can constructor be private in php?
What is the output of the ucwords function in this example?
Which function parses an English textual date or time into Unix timestamp in PHP.
how can i develop forum code? any one pleale help me on this question
What does the scope of variables mean?
What is the functionality of the functions strstr() and stristr()?
Does php require a web server?
Is uploaded file php?
When do you use define() and when do you use const. What are the main differences between those two?
What is the difference between require and include in php?