getting key value after page submitted

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
forbes
Forum Newbie
Posts: 1
Joined: Sat Jun 14, 2003 8:39 pm
Location: Rochester, MN

getting key value after page submitted

Post by forbes »

Hi all,
I am quite new to php, knowing just enough to break stuff. Anyway, I have an array to populate a product list (an html form pulldown). For example: '4x6'=>12, '8x10'=>15, etc. Once the page is submitted, I am trying to separate the key and value so I can use the value for some equations. (total cost, subtotal, etc.) This has me banging me head on the wall. Any help with this seemingly simple, yet elusive solution?

Thanks in advance,
Forbes
Paddy
Forum Contributor
Posts: 244
Joined: Wed Jun 11, 2003 8:16 pm
Location: Hobart, Tas, Aussie
Contact:

Post by Paddy »

I am really not sure what you are asking. It sounds like you are after string manipulation. If that is the case try here

http://au2.php.net/manual/en/ref.strings.php

They are all the functions available for strings. If you want more specific help then please be a little more descriptive of what it is you are after. Or you could just wait for someone more coherent. :)
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

From the manual, php.net:

"A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. As a regular expression, it would be expressed thus: '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*' "

Think that applies to array key names too.
Post Reply