Ok, so I am having a hard time figuring this one out and I am not sure which way to go yet.
Its pretty simple, and I have it working, but not the way I want.
1.) The user enters a name
2.) I take that name, break it down into an array
3.) convert each letter to an image
4.) Display them back.
This works, no problems, BUT, I want to combine them all into 1 image instead of a gaggle of individual images.
Each image is the same height, but different widths.
Any ideas? Thanks guys!
Example code below of what is working.
<?php
//grab the post data
$name = $_POST['username'];
$arr1 = str_split($name);
//loop through and convert the letter
if(isset($_POST['send']))
{
//build the image
foreach ($arr1 as $letter) {
switch ($letter)
{
case a:
$ran = rand(1,15);
$image = 'letters/a'.$ran.'.png';
break;
case b:
$ran = rand(1,3);
$image = 'letters/b'.$ran.'.png';
break;
// etc...though Z and a default
}
?>
<img src="<?php echo $image;?>">
<?php
}// ends foreach loop
?>