I'm really a noob at php, and I'm puzzled by a small dilemma:
I have a form mail system, and all fields are assigned a variable creatively named $variable. The form is an order submission (no payments or such), so those 23 fields which represent products have a prefix to their value of "val" (another demonstration of my blinding creativity!! :hehe: ). So if I wanted to submit an order for 5 widgets, the value would actually equal "val5".
Now, when the form gets emailed, I don't want it to display "widgets: val5". I want it to only display "widgets: 5".
So, I entered the following code into my php function which compiles all the information:
That works like a charm except for one problem - other fields, such as "name" "email" "comments" etc, get the first 3 characters lopped off.
So, how do I only get rid of the substring "var", rather than the first 3 characters of every single field??
I have a form mail system, and all fields are assigned a variable creatively named $variable. The form is an order submission (no payments or such), so those 23 fields which represent products have a prefix to their value of "val" (another demonstration of my blinding creativity!! :hehe: ). So if I wanted to submit an order for 5 widgets, the value would actually equal "val5".
Now, when the form gets emailed, I don't want it to display "widgets: val5". I want it to only display "widgets: 5".
So, I entered the following code into my php function which compiles all the information:
PHP:
build_message(substr_replace($value, '', 0, 3)
That works like a charm except for one problem - other fields, such as "name" "email" "comments" etc, get the first 3 characters lopped off.
So, how do I only get rid of the substring "var", rather than the first 3 characters of every single field??







