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

Re: [phpXperts] How to separate the 2 words in 2 lines

Expand Messages
  • Rahat Bashir
    If I have understood your problem correctly, following solution should work for you: The idea is, take the string, break into pieces and put each piece in an
    Message 1 of 8 , May 13, 2012
      If I have understood your problem correctly, following solution should work for you:

      The idea is, take the string, break into pieces and put each piece in an array, then print the array line by line; that's all.

      <?php

      $word = 'abcd bcda';

      $array = explode(' ', $word);

      foreach ($array as $value) {
          echo($value.'<br>');
      }

      ?>

      Rahat Bashir
      Sr. Assistant Director (MIS and Knowledge Management)
      MAMA Bangladesh Initiative




      On Mon, May 14, 2012 at 10:05 AM, Mety <metysoriano@...> wrote:
       

      Dear expert how to separate 2 words in 2 lines... Example the data is abcd dcba, the output should

      abcd
      dcba

      Please help me

      Thank you


    • Mety Soriano
      Example this is the data Fil. 354.914 .Z21p the result should Fil. 354.914 .Z21p Please help , str_ireplace does nt work   MATIAS Mety SORIANOMIS/IT
      Message 2 of 8 , May 13, 2012
        Example this is the data
        Fil. 354.914 .Z21p

        the result should
        Fil.
        354.914
        .Z21p

        Please help , str_ireplace does'nt work

         

        MATIAS 'Mety' SORIANO

        MIS/IT Director/Consultant/Professor

        URL: http://www.shc.edu.ph

        E-mail: metysoriano@... / metysoriano@...

        Contacts: Tel: (042)3736167 Cel: 09282860545

         



        --- On Mon, 14/5/12, Mizanur Lasker <mizanurl@...> wrote:

        From: Mizanur Lasker <mizanurl@...>
        Subject: Re: [phpXperts] How to separate the 2 words in 2 lines
        To: phpexperts@yahoogroups.com
        Date: Monday, 14 May, 2012, 12:49 PM

         

        <?php

        $words = 'abcd dcba';
        echo str_ireplace(' ', '<br />', $words);

        ?>


        From: Mety <metysoriano@...>
        To: phpexperts@yahoogroups.com
        Sent: Monday, May 14, 2012 10:05 AM
        Subject: [phpXperts] How to separate the 2 words in 2 lines

         

        Dear expert how to separate 2 words in 2 lines... Example the data is abcd dcba, the output should

        abcd
        dcba

        Please help me

        Thank you



      • Mety Soriano
        Thank you so much for the reply when i execute this is the result;   Array ( [0] = Fil. [1] = 899.211t [2] = D365a [3] = 1960 ) the result should be Fil.
        Message 3 of 8 , May 13, 2012
          Thank you so much for the reply when i execute this is the result;


            Array ( [0] => Fil. [1] => 899.211t [2] => D365a [3] => 1960 )

          the result should be

          Fil.
          899.211t
          D365a
          1960

          no word array, how to clean the array to remove the array and []..

          thank you so much




          MATIAS 'Mety' SORIANO

          MIS/IT Director/Consultant/Professor

          URL: http://www.shc.edu.ph

          E-mail: metysoriano@... / metysoriano@...

          Contacts: Tel: (042)3736167 Cel: 09282860545

           



          --- On Mon, 14/5/12, Saiful Islam <abssaiful@...> wrote:

          From: Saiful Islam <abssaiful@...>
          Subject: Re: [phpXperts] How to separate the 2 words in 2 lines
          To: phpexperts@yahoogroups.com
          Date: Monday, 14 May, 2012, 12:56 PM

           

          Please see this function

          PHP explode() Function

          Hope your purpose will be serve
          --
          Saiful Islam
          Gazipur, Bangladesh
          http://saifulbd.com/



          On Mon, May 14, 2012 at 10:05 AM, Mety <metysoriano@...> wrote:
           

          Dear expert how to separate 2 words in 2 lines... Example the data is abcd dcba, the output should

          abcd
          dcba

          Please help me

          Thank you


        • Mety Soriano
          Thank you so much it solves my problem... MATIAS Mety SORIANOMIS/IT Director/Consultant/ProfessorURL: http://www.shc.edu.phE-mail: metysoriano@yahoo.com /
          Message 4 of 8 , May 13, 2012
            Thank you so much it solves my problem...



            MATIAS 'Mety' SORIANO

            MIS/IT Director/Consultant/Professor

            URL: http://www.shc.edu.ph

            E-mail: metysoriano@... / metysoriano@...

            Contacts: Tel: (042)3736167 Cel: 09282860545

             



            --- On Mon, 14/5/12, Mizanur Lasker <mizanurl@...> wrote:

            From: Mizanur Lasker <mizanurl@...>
            Subject: Re: [phpXperts] How to separate the 2 words in 2 lines
            To: phpexperts@yahoogroups.com
            Date: Monday, 14 May, 2012, 12:49 PM

             

            <?php

            $words = 'abcd dcba';
            echo str_ireplace(' ', '<br />', $words);

            ?>


            From: Mety <metysoriano@...>
            To: phpexperts@yahoogroups.com
            Sent: Monday, May 14, 2012 10:05 AM
            Subject: [phpXperts] How to separate the 2 words in 2 lines

             

            Dear expert how to separate 2 words in 2 lines... Example the data is abcd dcba, the output should

            abcd
            dcba

            Please help me

            Thank you



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