Loading ...
Sorry, an error occurred while loading the content.

Re: [phpXperts] Need Help regrading interchange two value

Expand Messages
  • S.M. Abu Sayeed
    hi, sorry dear... I forget that. Regards, S.M.Sumon. ... From: ziaul haq To: phpexperts@yahoogroups.com Sent: Friday, September 26, 2008
    Message 1 of 13 , Sep 26, 2008
    • 0 Attachment
      hi,
      sorry dear... I forget that.
       

      Regards,
      S.M.Sumon.


      ----- Original Message ----
      From: ziaul haq <zia_112@...>
      To: phpexperts@yahoogroups.com
      Sent: Friday, September 26, 2008 10:32:08 AM
      Subject: Re: [phpXperts] Need Help regrading interchange two value

      Hi Sumon

      I think you also forgot your first mail.
      You never mention there about 'any function, any built in function'.

      You just told about third variable not function nor built in method.

      Take a look below about your first mail:
      '
      Hi all,
      I m in problem with a simple problem regrading interchange two value in the two variable without using any third variable.
      I can make it with any type of number and the char variable but when it's string variable on that time I can't solve the problem.
      '

      I think you shouldn't forgot it.

      Thsnks
      Zia


      ----- Original Message ----
      From: S.M. Abu Sayeed <hi_emelle@yahoo. com>
      To: phpexperts@yahoogro ups.com
      Sent: Friday, September 26, 2008 7:38:35 AM
      Subject: Re: [phpXperts] Need Help regrading interchange two value

      Hi,
          Hope doing good.I think U have miss my first mail.
          Please read my first mail. There I have mention u can't
         user any third variable, any function, any built in function.
         Have a nice time.
       

      Regards,
      S.M.Sumon.


      ----- Original Message ----
      From: Tasim Php <tasimphp@rocketmail .com>
      To: phpexperts@yahoogro ups.com
      Sent: Thursday, September 25, 2008 3:49:03 PM
      Subject: Re: [phpXperts] Need Help regrading interchange two value

      y dont u try by taking a temp variable. follow below codes:

      $a = "you";
      $b = "me";
      $temp;
      echo $a ." = ". $b ;
      echo "<br />";

      $temp = $a;
      $a = $b;
      $b=$temp;
      echo $a ." = ". $b ;

      values are swapped

      Tasim Khan
      India

      ----- Original Message ----
      From: A.N.M. Saiful Islam <anm.saiful@yahoo. com>
      To: phpexperts@yahoogro ups.com
      Sent: Thursday, September 25, 2008 1:00:35 PM
      Subject: Re: [phpXperts] Need Help regrading interchange two value

      Here is another Solution:
       
      $a = "aaa";
      $b = "bbbbb";
       
      $a = $a . $b;
      $b = str_replace( $b, '', $a );
      $a = str_replace( $b, '', $a );
       
       

      "S.M. Abu Sayeed" <hi_emelle@yahoo. com> wrote:
      Hi Arafat,
      Thanks for ur nice solution.
      But did u check ur code with $a = 'Arafatabcdefgh' and $b ='Rahman'.
      Then u can swap only first 6 char not in the full of $a with $b.
      I think the xor  is not the right solution.
      U can not do this using xor.
       

      Regards,
      S.M.Sumon.


      ----- Original Message ----
      From: Arafat Rahman <opurahman@gmail. com>
      To: phpexperts@yahoogro ups.com
      Sent: Wednesday, September 24, 2008 8:31:18 AM
      Subject: Re: [phpXperts] Need Help regrading interchange two value

      Hi Sumon,
      To swap two string variable you can use xor. Here is an example.

      $a = 'Arafat';
      $b = 'Rahman';

      echo($a . ' - ' . $b . '<br />');

      $a = $a ^ $b;
      $b = $a ^ $b;
      $a = $a ^ $b;

      echo($a . ' - ' . $b . '<br />');


      Arafat Rahman
      http://arafatbd. net






      $@!ful

      email@anm-saiful. info

      http://anm-saiful. info


      Connect with friends all over the world. Get Yahoo! India Messenger.




    Your message has been successfully submitted and would be delivered to recipients shortly.