RE: [PHP] Call to endefined function error
| From: | Dan Joseph | Date: | Tue, 22 Apr 2003 16:32:07 +0000 |
| Subject: | RE: [PHP] Call to endefined function error | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-144864@lists.php.net to get a copy of this message | ||
Hi,
instead of just pad, use $this->pad
-Dan JOspeh
> -----Original Message-----
> From: shaun [mailto:shaun@mania.plus.com]
> Sent: Tuesday, April 22, 2003 12:31 PM
> To: php-general@lists.php.net
> Subject: [PHP] Call to endefined function error
>
>
> Hi,
>
> I have the following class:
>
> <?php
> class MyCalendar extends Calendar
> {
> function getCalendarLink($month, $year){
> $s = getenv('SCRIPT_NAME');
> return "$s?month=$month&year=$year&goto_date=yes";
> }
>
> function pad($s, $n){
> $r = $s;
> while (strlen($r) < $n){
> $r = "0".$r;
> }
> return $r;
> }
>
> function getDateLink($day, $month, $year)
> {
> $d = pad($day, 2);
> $m = pad($month, 2);
> $y = pad($year, 4);
> $s = getenv('SCRIPT_NAME');
> return "$s?day=$d&month=$m&year=$y&goto_date=yes";
> }
> }
> ?>
>
> However i keep getting the following error:
>
> Fatal error: Call to undefined function: pad() in
> /home/w/o/workmanagement/public_html/MyCalendar.php on line 19
>
>
> Any ideas?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>