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
Why php is widely used?
How to include variables in double-quoted strings in php?
How to define a user function?
How values in arrays are indexed?
What is string function sql?
Can I learn php without knowing c?
What is php simple definition?
What does $_env means?
how to use http headers inside php? Write the statement through which it can be added?
What is the difference between single-quoted and double-quoted strings in php?
What is the use of session and cookies in php?
What is call by reference in php?
What is member function?
What are the 5 types of data?
What is the capacity of mysql database?