How to Insert elment into array through FOR loop.
Posted: Thu Jun 22, 2006 8:40 pm
feyd | Please use
PLEASE HELP.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi,
I need to develop polish notation calculator to convert prefix expression to postfix expression. Thus, i need to imake array, and insert element through for loop. I do not knw how to do that. Please help, i tried this code, but it does npot work, because, it takes only the lastest value:Code: Select all
while($d<2)
{
if($str[$s]=='1'||$str[$s]=='2'||$str[$s]=='3'||$str[$s]=='4')
{
$operand =array($d => $str[$s]);
$s++;
}
$d++;
}feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]