Pulling simplexml and parsing them into php variables. I have a form with arrays in them. I want a button outside the form that will "essentially" go to the same form but with the next array number. IE:
<?
if( $xml = simplexml_load_file('my.xml') ) {
foreach( $xml as $SAVED_EXPORT) {
$mfg = $SAVED_EXPORT->productmanufacturer;
}
}
?>
<form id="myform" method="post" action="coderdb.php">
<input type="text" value="<? echo $mfg[0] ?>" name="MFG" />
<input type="submit" />
</form>
I'd like to have a button that says NEXT that when clicked it will pull up the next array ie. $mfg[1]
. I believe the page would have to be reloaded which is fine. I read somewhere I may have to use $key
but have never used and I am not exactly sure its what I need here.