Hi,

Wonder if anybody can offer some advice

Have been working through Julie Meloni Book PHP fast and easy web development

One of the examples is a record collection which includes a notes section... whilst the box for entering data wraps on each line... how do I format the resulting output on a php page so that when a record is displayed the text in the notes section does not stretch across the whole of the screen... In other words how do I tell it to display a maximum of lets say 80 characters per line

Thanks
Mel

    if your variable is named lets say $text. create a new variable using php's substr() function found here:

    http://www.php.net/manual/en/function.substr.php

    so:

    $newtext=substr($text, 0, 80);
    echo $newtext;

    Otherwise, the best way to format a bunch of data is to use html tables and such to limit size of the page and other stuff.

    Hope this helps.

      Write a Reply...