I am not good at computer programming and have a problem in understanding a Fortran statement. I would like to convert the following statement in Fortran into PHP. Really appreciate your help!
PARAMETER (a=10 ,b=6) CHARACTER*5 WE(a)
1) What does CHARACTER*5 WE(a)
mean in Fortran?
2) How can I write it in PHP?
Thanks
CHARACTER*5 WE(a)
declares an array of a
elements, each element being a character variable of length 5.
Your first line of Fortran code PARAMETER (a=10 ,b=6)
can be written in PHP as:
<?php
define('a', 10);
define('b', 5);
?>
Those are called constants, a special type of variable that will not change during execution of the program.
Your second line of Fortran code CHARACTER*5 WE(a)
isn't portable to a PHP program (and it isn't needed, as well), because PHP will dynamically allocate memory for your arrays, and so you can't have an array with pre-determined size.