Two functions in one
-
Please tell me how to write the new code correctly.
There is such a parameter:
<param name = "Gender"> Male, Female </param>
To record both, I use:
[str_replace (",", "|", {param [@ name = "Gender"]})]
To change the parameter names like in my directory I use:
[my_map_data ({param [@ name = "Gender"]})]
function my_map_data ($ data) { $ map = array ( 'Male' => 'for men', 'Female' => 'for women', 'In this' => 'Array' ); return (array_key_exists ($ data, $ map))? $ map [$ data]: $ data; }
Question: What should be done and how to write the code, if you need to specify both the first and second codes?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Two functions in one’ is closed to new replies.