Reverse a sting using loop in php

Hi , when I reverse a string using loop in php like
Code
  1. $str="navin";

  2.  $rstr=""
Copyright GeekInterview.com

It work but I want to know why we use .dot(.) $rstr.=$str[$i]; over here thanks in advance

Questions by navin3434

Showing Answers 1 - 1 of 1 Answers

Emiliano Gaytan

  • Mar 21st, 2013
 

To concat, . operator concats left & right values; Google it for more info

Code
  1. span style="font-style: italic;">// declare variable in php

  2. "<br>");  //print on screen your variable w html brake to next line and using concat . operator

  3. // concat  variable to itself using . operator

  4. "<br>");// print as before

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions