basic PHP help

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
dast
Forum Newbie
Posts: 4
Joined: Mon Mar 17, 2008 6:59 am

basic PHP help

Post by dast »

I have a form with form fields named PROD_1234-2_12_25 etc. I need to loop through the form and any fields that have a value in I ned to strip the PROD_ bit and the bit after the _.

For example PROD_1234-2_12_25 would become 1234-2. Can anyone help me? Thanks in advance
Walid
Forum Commoner
Posts: 33
Joined: Mon Mar 17, 2008 8:43 am

Re: basic PHP help

Post by Walid »

Assuming that the structure always stays the same:

Code: Select all

$ValueArray = explode("_", $FormName);
$RequiredValue = $ValueArray[1];
Post Reply