1

Like "Multi thinker" its a string... in php how i can split it that multi shows in left and thinker shows in right like

MULTI                                                                                                                       Thinker

i will create a user input name whatever he input 'full name' will split like above.

here is the code i try

    <?php

      $name = $_POST['name'];

     echo str_replace(" ","\t \t",$name);
   ?>

here i used str_replace i already tried preg and ereg replace but it doesnt meet my requirement.

1
  • 1
    This is more a HTML than PHP issue. Commented Sep 21, 2014 at 5:39

1 Answer 1

1

Try something like this:

$name = 'Multi thinker';
$data = explode(' ',$name);
echo '<div>
      <div style="float:left">'.$data[0].'</div>
      <div style="float:right">'.$data[1].'</div>
      </div>';
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.