PHP imagettftext center text -
I have to focus a text in the image using imagepng; The imagettftext function in php.
Here is my code:
Include "config.php"; Header ('content type: image / png'); Between functions ($ src, $ start, $ end) {$ txt = explosion ($ start, $ src); $ Txt2 = Explosion ($ end, $ txt [1]); Return trim ($ txt2 [0]); } $ Genuine = "http: // $ _ server [HTTP_HOST] $ _SERVER [REQUEST_URI]"; $ Background1 = "file / bg page"; $ Background = imagecreatefrompng ($ background1); // phones $ Tahma = "file / tarahoma.tff"; $ Bebas = "files / BebasNeue.otf"; $ Italic = "file / taahoma italic.TTF"; $ Bold = "files / TahomaBold.ttf"; A // COLORS $ gray = imagecolorallocate ($ background, 76, 76, 76); $ Dark_shadow = imagecolorallocate ($ background, 16, 181, 188); // NAME Fictional ($ background, $ 32, 0, 181, 173, $ gray, $ twentybus, urlcode (between $ real, "name =", "|"))); Imagepng ($ background); Imagedestroy ($ background);
The text url parameter is on "name". I need to center this text in the image.
imagettftext ($ background, 32, 0, 181, 173, $ gray, $ bebas, urldecode ($ actual, "name =", "|"))); ________________________________________ | | | | | My Text | | | | | | | | | | | ---------------------------------------
A URL parameter like mypage.php? Name = thename and submit = submit name = and |
is not necesarily between In PHP, you can use the $ _ request
to get an array of URL parameters.
Comments
Post a Comment