the text in the photo is that: PHP: Player->sendPopup("§a§lExample§r\n§bof a popup not centered"); to make it centered i need to add spaces like: PHP: Player->sendPopup("§a§l Example§r\n§bof a popup not centered"); the problem is that the text can change so, i can't decide how many spaces to add. I tryed with strlen() to count the text lenght... example: PHP: $line1 = 'a text that can change';$line2 = 'another text that can change';$len1 = strlen($line1);//22 in this case$len2 = strlen($line2);//28 in this case$spacesToAdd = floor(((max($len1, $len2) - min($len1, $len2))/2));// 28 - 22 = 6 ; 6/2 = 3 ; floor(3) = 3 . so i need to add 3 spaces before the $line1//to add these spaces i'm using a for loop like: $line1 = ' '.$line1; repeated for 3 times (in this case) ... another way? But is not working (not centered text) Can someone help me please? sorry if my english is not good.