Lable single quotes problem

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Lable single quotes problem

Post by agriz »

$text = "test"; //works
$text = "this's"; //not working

$string = " -background transparent" . " -font '{$font}'". " -pointsize {$font_size}". " -gravity center label:'".$text."'".$stroking;

How to fix this?
ustas19
Posts: 4
Joined: 2011-10-17T09:37:32-07:00
Authentication code: 6789
Location: ne-bra-sko

Re: Lable single quotes problem

Post by ustas19 »

It looks like you use imagick from command line.

and you need escape you single quote with \

try $text = "this\'s";

or you can use addcslashes or similar function.
Make movie online for free, easy&fast.
agriz
Posts: 237
Joined: 2011-10-01T02:21:30-07:00
Authentication code: 8675308

Re: Lable single quotes problem

Post by agriz »

Thanks!
Post Reply