By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,009 Members | 1,643 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,009 IT Pros & Developers. It's quick & easy.

add function to a string

P: 1
I need to add one of my functions to the following code:
Expand|Select|Wrap|Line Numbers
  1. $string = '<div class="row">;
  2.             <label class="col1">State or Province</label>
  3.             <span class="col2"><select name="billing[state]" class="mid2" onChange="ShopperPress_ChangeState_Value(this.value)">';
  4.             $string .= '<option value="0">-------- Select ----------</option>';
  5.             foreach($states as $val){
  6.                 $string .= '<option value="'.$val.'">'.$val.'</option>';
  7.             }
  8.  
  9.             $string .= '</select></span></div>';
  10.             print $string;
  11.  
  12.     }else{
  13.             print  '<div class="row">
  14.             <label class="col1">State or Province</label>
  15.             <span class="col2"><input type="text" name="billing[state]" class="mid2" size="35" maxlength="100"/></span>
  16.             </div>        
  17.              ';
  18.     }
Where text is being printed, such as "State or Province", I need to add the function that will connect to my language file to display that text in different languages. I would normally replace such text with the following:

Expand|Select|Wrap|Line Numbers
  1. <?php echo SPEC($GLOBALS['_LANG']['State or Province']) ?>
But I can't get the syntax right amongst the other PHP.
Sep 30 '11 #1
Share this Question
Share on Google+
1 Reply


100+
P: 1,059
are you getting syntax error??? or what???

If you get syntax error then post it
Oct 1 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.