Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is stdclass in php?

941


What is php in simple words?

998


What is the default time of cookie in php?

976


How does php strcmp work?

1045


Can you pass an array into a function?

1051


Does php pass arrays by reference?

1080


What is php in full?

929


What is the difference between laravel and php?

912


What are the differences between GET and POST methods in form submitting?

1039


What is substr() in php? And how it is used?

1025


What is the use of mysql_real_escape_string() function?

914


What are Routines?

2218


What happens when submit button is clicked?

921


What is difference between mysqli and mysql?

1047


How can we change the maximum size of the files to be uploaded?

1023