Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Storing and displaying arrays

New Here ,
Apr 14, 2006 Apr 14, 2006

Copy link to clipboard

Copied

I am using PHP and MySQL and would be grateful for some help on the following:

I have a recordset which display selected information from within my db, I want to be able to split a memo field so that on initial view of the page only the first 100 characters are displayed. I then want to provide a link which will dynamically extend the record in questions memo field to its fullest. I have thanks to previous help worked out how to split the field (code below) and successfully display only the first hundred characters. I understand that I simply need to call the remainder of the array to display the entire field.

Can someone please help on this?

Many thanks
Luke


=== code =======

<?php function splitMemo($memo)
{
$retVal = array();
// find first space after 100 characters
$pos = strpos($memo, ' ', 100);
// extract first and second halves
$retVal[0] = substr($memo, 0, $pos);
$retVal[1] = substr($memo, $pos+1);
// return array of both halves
return $retVal;
}
$parts = splitMemo($row_HP['Description']);
;
echo $parts[0]
?>
TOPICS
Server side applications

Views

172
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 17, 2006 Apr 17, 2006

Copy link to clipboard

Copied

LATEST
Is anyone able to shed some light on this?

Many thanks
Luke

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines