Re: Beginner Needing Push in right direction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



//build a string of $HowWide spaces.
//There might be a function to do this, but I can't find it right now
$spaces = ' ';
for($i=0;$i<$HowWide;$i++)
    $spaces .= ' ';

//a simple way to deal with strings that are too long or too short in 
one step.
for($i=0;$i<$HowManyLines;$i++)
    for($j=0;$j<$HowManyAcross;$j++)
        DataEntered[$i][$i] = substr(DataEntered[$i][$i] . 
$spaces,0,$HowWide);

Good luck.

-jmb

James R. wrote:

>I'm looking for some help on a project im doing.
>THe project is to allow user input through a form, format it to the
>correct size based on user input, then write to a file.
>
>Basic structure:
>Cobol Text File Creator (my college is too stuck up to get a DFU),
>P1.ask how many entries per line, => how many across
>p1.how many lines,  => how many down
>P2 create drop down to allow user input on how wide they want that
>column's char should be. =>$HowWide
>P2 create table based on P1 Information.
>P3 (this is where im having trouble)
>P3 gather user information, process it as:
>for 1; HowManyLines
>  for 1; HowMany Across
>   userdata = DataEntered[HowManyLines][HowManyAcross]
>   if strlen(userdata) < $HowWide
>      add " " until userdata = $HowWide// " " is a blank space
>   elseif strlen(userdata) > $HowWIde
>      substr(userdata, 0, $HowWide)
>// if you have a spot that is suppose to be 25 char long, but you only
>// have a 15 char long entry, you need 10 spaces or visa versa.
>
>however, i am unable to do anything on P#3. I have put all the user
>data into a multi dem array but, i am unable to recall it inside the
>for loops.  any suggestions or a push in the right direction. (more
>than likely im doing it all wrong=).
>
>any help would be greatful.
>James
>
>
>
>
>
>
>
>PHP Data object relational mapping generator
>http://www.metastorage.net/ 
>Yahoo! Groups Links
>
>
>
> 
>
>
>
>
>
>  
>



PHP Data object relational mapping generator
http://www.metastorage.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux