Forum Moderators: coopster

Message Too Old, No Replies

PHP variable containing Adsense code

How do you put the adsense advert code in a php variable?

         

edward301

9:36 pm on Apr 12, 2005 (gmt 0)

10+ Year Member



How do you/is it possible to put the adsense advert code in a php variable?

HughMungus

9:47 pm on Apr 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can't you just do:

$code = '[adsense code here]';

edward301

10:12 pm on Apr 12, 2005 (gmt 0)

10+ Year Member



unfortunately not, i still get parse errors it is possible that something else in my php code is interfering with it but i dont see how.

4string

10:20 pm on Apr 12, 2005 (gmt 0)

10+ Year Member



Are you escaping quotes?

If you are saying $code = 'This is my code';

Any single quotes need escaping
$code = 'This is someone else\'s code';

Same with double quotes
$code = "code with \"double quotes\"";

edward301

10:28 pm on Apr 12, 2005 (gmt 0)

10+ Year Member



Thanks 4String thats solved it i dont know how i missed it.