473,396 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

add function to a string

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
1 1413
johny10151981
1,059 1GB
are you getting syntax error??? or what???

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

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

Similar topics

8
by: Filip Dreger | last post by:
Each function has a func_code property that is suposed to contain the pure bytecode of the function. All the context (including reference to relevant namespaces) is stored in different fields of...
2
by: Al Bondy | last post by:
Hi, I'm trying to use the XSL function string-join() as explained at the following link : http://www.w3.org/TR/xpath-functions/#func-string-join Here is my line of code <xsl:value-of...
4
by: higabe | last post by:
Three questions 1) I have a string function that works perfectly but according to W3C.org web site is syntactically flawed because it contains the characters </ in sequence. So how am I...
9
by: Kishor | last post by:
Hi all, I am Using VB.Net for developing my application. I am now needed help. In this project I have to execute some function, but I cannot call them directly using function name, I wanted to...
1
by: Wally | last post by:
Is there in VB NET something like the old Vb6 STRING$() function? Thanks. VV
6
by: Uwe Grawert | last post by:
I have the following recursive function: string find_value_by_key (xmlDocPtr doc, xmlNodePtr root_node, const string& key) { while(root_node != NULL) { if(! xmlStrcmp( root_node->name,...
16
by: recover | last post by:
#include <string> #include <iostream> using namespace std; class TConst { private: string con; string uncon; public:
2
by: rn5a | last post by:
All the String functions like 'Len', 'Left', 'Right', 'Mid' etc. that are available in ASP are supported by ASP.NET as well except for the string function 'String'. The 'String' function takes...
3
by: MrHenry007 | last post by:
Hello! I'm fairly new to c++ but I have been following tutorials and have created functions before, but not one using a string. I can't work out what the problem is here. The function is supposed...
3
by: JSwizzle | last post by:
This is what I have so far: // This program changes 'the' to 'that' #include <iostream> #include <string> using namespace std; // Function prototype void replaceSubstring(string1,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.