> -----Original Message-----
> From: SOHH.com Webmaster [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 19, 2001 4:45 PM
> To: Mark Roedel
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP-DB] Help Me Fix My User Defined Funtion
> 
> 
> However, since posting my question, I have solved it by doing 
> the following:
> 
> <?php
> while($row_listbyreads = mysql_fetch_array($result_listbyreads)) {
>       $sectionID = $row_listbyreads["sectionID"];
>       $contentcount = $row_listbyreads["contentcount"];
>       $contentheadline = 
> stripslashes($row_listbyreads["contentheadline"]);
>       $contentID = $row_listbyreads["contentID"];
> 
> ?>
> <tr>
> <td><a href="<?php echo generatesectionlink($sectionID,$contentID);
> ?>"><?php echo $contentheadline; ?></a></td>
> <td><?php echo $contentcount; ?></td>
> </tr>
> <?
> }
> ?>
> 
> Which works but what if I wanted to use the results to do 
> something else?  Like take the string ($link) and count the
> lenght of it (just an example).

You can keep calling the function every time you need the value

        $stringlength =
strlen(generatesectionlink($sectionID,$contentID);

OR

you could just assign the return-value of the function to a variable and
use that for the remainder of that run through the loop.

        $thislink = generatesectionlink($sectionID,$contentID);
        $linklength = strlen($thislink);
        echo $thislink;


---
Mark Roedel           | "The most overlooked advantage to owning a
Systems Programmer    |  computer is that if they foul up there's no
LeTourneau University |  law against whacking them around a little."
Longview, Texas, USA  |                          -- Owen Porterfield 

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to