需要帮助javascript提示与PHP

i am using javascript field hint. problem occurred when I try to put code php translation into the hint itself.

<?php $interest= '<span class="hint">Eg: Cooking or Singing or Dancing<span class="hint-pointer">&nbsp;</span></span>';?>

if i try to put

 <?php    
$interest = '<span class="hint">__("Eg: Cooking or Singing or Dancing")<span class="hint-pointer">&nbsp;</span></span>';?>

the field hint at page will be displayed like this "__("Eg: Cooking or Singing or Dancing")"

if i try to put

$interest = '<span class="hint">__('Eg: Cooking or Singing or Dancing')<span class="hint-pointer">&nbsp;</span></span>';?>

or

$interest = '<span class="hint">' __('Eg: Cooking or Singing or Dancing')'<span class="hint-pointer">&nbsp;</span></span>';

error will be displayed:

Parse error: syntax error, unexpected T_STRING in C:\wamp\www\estandard\app\views\companies\company.ctp on line 7"

thanks in advance.

Try this:

 $interest = '<span class="hint">'.__('Eg: Cooking or Singing or Dancing').'</span>';

That is if you want the value of interest to the be localized version of the string 'Eg: Cooking or Singing or Dancing'.

The error for the last example is caused by missing your concatenation symbol. This should work:

$interest = '<span class="hint">'.__('Eg: Cooking or Singing or Dancing').'<span class="hint-pointer">&nbsp;</span></span>';