Page 1 of 1

basic PHP help

Posted: Mon Mar 17, 2008 7:00 am
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

Re: basic PHP help

Posted: Mon Mar 17, 2008 8:57 am
by Walid
Assuming that the structure always stays the same:

Code: Select all

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