Jump to content

Help problems with ' (single quote marks)


james13009

Recommended Posts

This is my code:

 

<a href="javascript:PlayerpopUp(''.$item['nsstream'].'')">

 

and this is my problems the '.$item['nsstream'].' is calling up an item in the style sheet and must have ' (single quote marks around it) (this item is a link)

 

The javascript is calling a popup link and must put the url in ' (single quote marks)

 

Yet PHP won't let me put '' (two side by side quote marks) without calling an error.

 

I am only a novice at PHP but can anyone help me, what am i doing wrong?

 

James

Link to comment
https://forums.phpfreaks.com/topic/83518-help-problems-with-single-quote-marks/
Share on other sites

thank you very much, lifesaver.

 

It work great! 

 

Though i do think its odd that solution is:

<a href="javascript:PlayerpopUp(\''.$item['nsstream'].'\')">

 

i would have assumed it would be

 

<a href="javascript:PlayerpopUp('\'.$item['nsstream'].'\')">

 

or

 

<a href="javascript:PlayerpopUp(\".$item['nsstream']."\)">

 

or do these work as well? Just odd to me

 

;) Thanks again.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.