EDIT: What I want to achieve can be seen here: http://www.hearthcards.net/
I want that the first character not to be changed. Second and third to be changed by about 2 degress, 4th and 5th to be changed by about 5 degrees and so on... So it would look like this: https://hearthstonehungary.hu/card/38531/aberrant-berserker (the Aberrant Berserker text on the image is rotated)
I have this in the code:
imagettftext($top_image, $font_size, 0(rotation would be this), $position_center, 233, $white, $font, $text);
It's working, but this won't rotate the text, because I set it to 0. I was thinking about replacing that 0 with $rotate and write something like this:
if (strlen($text) == (1)) {
$rotate=0;
}
else
{
$rotate=20;
}
So I checked if at least this works and yes it worked, but I don't need "if", I want that text == 1 not to be rotated, text == 2 and text == 3 to be rotated by 2 and so on... May I need to split it to 20 parts(because they can input a maximum of 20 words there)? Any help would be greatly appreciated.