Log in

View Full Version : Mixing a word in another word



letom
05-15-2013, 03:21 PM
Adrain, can u suggest a solution for the following ?


<?php

$tm = "Nice";
$ad = "Well";

?>

I want to mix $tm in $ad (Nice in Well) not using concat (Nicewell).
but some thing as following.

Nwicelle or some thing any complex string...

Thanks

Tom

Beverleyh
05-15-2013, 03:45 PM
You could do;
<?php
$tm = "Nice";
$ad = "Well";
$mix = str_shuffle($tm.$ad);
echo $mix;
?>

The results will be different every time though so it depends on what you're trying to achieve.

letom
05-15-2013, 05:20 PM
Thanks .. @Beverley
Is there any way to put the string in specific field.. suppose

$ry = ABCDEFGHIJKLMNOP
$ty = BNGH

putting BN after char A(1st char) and GH after(last char) P (shuffling changes insertions different in different time)..