Jump to content

Echo text onto image problem


Cragsterboy

Recommended Posts

 

ok i was following this :

 

http://www.phpjabbers.com/put-watermark-on-images-using-php-php20.html

 

so i could create an image with custom text on it.

 

But i want the custom text i want on it is an output from the following code:

 

   <?
   $results = explode("\n", trim($results));

echo '<table><td>'; // Start a table

echo $Player1."</td><td>".$Player2."</td></tr><tr><td>";

$size = count($results);
$valBreak = '</td><td>'; // Set the value that will be put between the values
for($i = 0; $i < $size; ++$i) {
echo $results[$i];

// See if the next value starts with '-' and output it if it is
if(isset($results[$i+1]) && $results[$i+1][0] == '-') {
	echo ' ' . $results[$i+1];
	++$i; // Move the pointer up one since we've outputted 2 values this loop
}

// Output the between-item value if it isn't the last loop of the array
if(isset($results[$i+1])) {
	echo $valBreak;
}

// Swap the between-item value every other loop
$valBreak = ($valBreak == '</td><td>') ? '</td></tr><tr><td>' : '</td><td>';
}

echo '</td></tr></table>'; // End the table

?>  


 

how do i do this?

 

Thanks,

 

~Crag

 

Link to comment
https://forums.phpfreaks.com/topic/131008-echo-text-onto-image-problem/
Share on other sites

humm ive tried what you suggested but no success, so im going to explain fully what my script does.

So far atm it converts a duel report into a table layout so it looks nice, you can see it here:

 

http://cakeisalie.info/westconverter/image.php

 

the output it gives i would like it to go onto an image :)

 

sorry about this but im a bit of a noob at php

 

Thanks,

 

~Crag

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.