Re: Help, Parse error caused by quotes andapostrophes in function, How do I fix this?

From: Date: Wed, 11 Sep 2002 09:52:00 +0000
Subject: Re: Help, Parse error caused by quotes andapostrophes in function, How do I fix this?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-115943@lists.php.net to get a copy of this message
try this: exec('convert picture.jpg -font Arial-Bold -pointsize 20 -fill red -gravity southeast -draw "text 10,10 \'my text to add to picture\'" text-overlay.jpg'); when you start with a single quote -> you have to end with a single quote while escaping (using "\") all its occurences in the used string. Elias, "Kurtis Harper" <napalm@pei.eastlink.ca> wrote in message news:20020910192359.20033.qmail@pb1.pair.com... > The following is the format needed in order to run the convert command from > command line, but I have a problem in exec() format: > > > > convert picture.jpg -font Arial-Bold -pointsize 20 -fill red -gravity > southeast -draw "text 10,10 'my text to add to picture'" text-overlay.jpg > > > > > this causes problems "Parse error: parse error, unexpected T_STRING": > > > > exec('convert picture.jpg -font Arial-Bold -pointsize 20 -fill red -gravity > southeast -draw "text 10,10 'my text to add to picture'" text-overlay.jpg'); > > > > I am positive the it is due to all the "s and 's within the command, I have > tried the specialchars for quotes andapostrophes but I am still missing > something: > > > > exec('convert picture.jpg -font Arial-Bold -pointsize 20 -fill red -gravity > southeast -draw &quottext 10,10 \'my text to add to picture\'&quot > text-overlay.jpg'); > > > > If anyone has any ides on how to avoid probles with quotes andapostrophes > inside the exec() I am all ears :o) > > > > > > Thanks > > > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.386 / Virus Database: 218 - Release Date: 9/9/2002 > >

« previous php.general (#115943) next »