php-general Digest 7 Nov 2004 10:44:57 -0000 Issue 3098

Topics (messages 201381 through 201414):

Re: Recover POST form
        201381 by: Christian Ista
        201382 by: Christian Ista
        201383 by: M. Sokolewicz

PHP Accelerator
        201384 by: David
        201385 by: raditha dissanayake
        201398 by: Jyry Kuukkanen
        201406 by: Danny Brow
        201408 by: Klaus Reimer

Object oriented??
        201386 by: Aalee
        201387 by: Robert Cummings
        201389 by: Aalee
        201391 by: Robert Cummings
        201392 by: Larry E. Ullman
        201400 by: Larry E. Ullman
        201407 by: Robert Cummings
        201412 by: Jonel Rienton

Using fonts in TrueType suitcases on a Mac?
        201388 by: Ken Tozier
        201397 by: David Schlotfeldt
        201401 by: Ken Tozier

loking for a item in string?
        201390 by: Dustin Wish with INDCO Networks

NMax
        201393 by: John Taylor-Johnston
        201394 by: John Taylor-Johnston
        201396 by: David Schlotfeldt
        201399 by: nate.savingadvice.com
        201409 by: M. Sokolewicz

Syntax problem - dynamic static member access
        201395 by: Jake Press
        201403 by: Jason Barnett
        201405 by: Jake Press
        201410 by: M. Sokolewicz

Adding to a Date
        201402 by: Matt Cassarino
        201404 by: Jason Barnett
        201411 by: M. Sokolewicz

pspell problems
        201413 by: Noodles

Javascript and php
        201414 by: Reinhart Viane

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
> echo '<pre>';
> print_r($_POST);
> echo '</pre>';

I have something like that :

Array
(
    [5980915] => on
    [ToDo5980915] => N
    [5941846] => on
    [ToDo5941846] => N
    [5916500] => on
    [ToDo5916500] => N
    [5907115] => on
    [ToDo5907115] => N
    [5900019] => on
    [ToDo5900019] => N
    [5899239] => on
    [ToDo5899239] => N
    [5897854] => on
    [ToDo5897854] => N
    [5896483] => on
    [ToDo5896483] => N
    [5893286] => on
    [ToDo5893286] => N
    [5865056] => on
    [ToDo5865056] => N
    [fa] => test
)

I'd like to access this array in a for loop from an array from 0 to ....21 
(in this case). How to transform this array ?

I tried $_POST[2] but not work ....

Thanks, 

--- End Message ---
--- Begin Message ---
> I tried $_POST[2] but not work ....

with arrays_keys :)

Thanks, 

--- End Message ---
--- Begin Message ---
Christian Ista wrote:

echo '<pre>';
print_r($_POST);
echo '</pre>';


I have something like that :

Array
(
    [5980915] => on
    [ToDo5980915] => N
    [5941846] => on
    [ToDo5941846] => N
    [5916500] => on
    [ToDo5916500] => N
    [5907115] => on
    [ToDo5907115] => N
    [5900019] => on
    [ToDo5900019] => N
    [5899239] => on
    [ToDo5899239] => N
    [5897854] => on
    [ToDo5897854] => N
    [5896483] => on
    [ToDo5896483] => N
    [5893286] => on
    [ToDo5893286] => N
    [5865056] => on
    [ToDo5865056] => N
    [fa] => test
)

I'd like to access this array in a for loop from an array from 0 to ....21 (in this case). How to transform this array ?

I tried $_POST[2] but not work ....

Thanks,

look. Read a BASIC tutorial about how PHP works, and how to write scripts in PHP. Once you've done that, return here, and I guarantee you, the questions you've asked will be no more.

--- End Message ---
--- Begin Message --- I need a PHP accelerator but am not sure which one to use. I would highly prefer to not use a commercial accelerator and need one that works with PHP 5. Does anyone recommend one out of the ones that exist?

Here are the ones I am aware of..but have no idea which ones are better than others.
- After Burner
- APC
- ionCube PHP Accelerator
- Turck MMCache for PHP


Thanks,
David

--- End Message ---
--- Begin Message ---
David wrote:

I need a PHP accelerator but am not sure which one to use. I would highly prefer to not use a commercial accelerator and need one that works with PHP 5. Does anyone recommend one out of the ones that exist?

this one:

- Turck MMCache for PHP




--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/         | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.

--- End Message ---
--- Begin Message ---
On Sun, 7 Nov 2004, raditha dissanayake wrote:

> David wrote:
> 
> > I need a PHP accelerator but am not sure which one to use. I would 
> > highly prefer to not use a commercial accelerator and need one that 
> > works with PHP 5. Does anyone recommend one out of the ones that exist?
> >
> this one:
> 
> > - Turck MMCache for PHP


I second that, unless you need it with latest PHP4.3.x, that Turck MMCache 
does not support currently. Then the free option known to work is 
PHP-Accelerator.

-- 
--Jyry
C|:-(    C|:-/    C|========8-O    C|8-/    C|:-(

--- End Message ---
--- Begin Message ---
On Sun, 2004-11-07 at 07:55 +0200, Jyry Kuukkanen wrote:
> On Sun, 7 Nov 2004, raditha dissanayake wrote:
> 
> > David wrote:
> > 
> > > I need a PHP accelerator but am not sure which one to use. I would 
> > > highly prefer to not use a commercial accelerator and need one that 
> > > works with PHP 5. Does anyone recommend one out of the ones that exist?
> > >
> > this one:
> > 
> > > - Turck MMCache for PHP
> 
> 
> I second that, unless you need it with latest PHP4.3.x, that Turck MMCache 
> does not support currently. Then the free option known to work is 
> PHP-Accelerator.
> 

According to the website:

"This version of the Turck MMCache has been successfully tested on PHP
4.1.0-4.3.3 under RedHat Linux 7.0, 7.3, 8.0 and Windows with Apache 1.3
and 2.0."

But David asked for something that works with PHP 5. It seems that most
work with the 4.x releases of PHP.

Dan.

--- End Message ---
--- Begin Message --- raditha dissanayake wrote:
this one:
- Turck MMCache for PHP

Turck MM Cache does not work with PHP 5. It's possible to compile and load it and some pages are working but most of the time it segfaults.

By the way: Does anybody know if the Turck MM Cache project is still
active? The last change in CVS is 5 months old, the last release is
nearly a year old. And there were rumors that the main developer was
assimilated by Zend.

--- End Message ---
--- Begin Message ---
Hi there,
Is PHP an object oriented language. If not is it gonna be?
Cheers

--- End Message ---
--- Begin Message ---
On Sat, 2004-11-06 at 21:44, Aalee wrote:
> Hi there,
> Is PHP an object oriented language. If not is it gonna be?

Did you spend 10 seconds looking?

Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
Yes of course...but was confused since some says it is so and some says it
is not...So thought of asking the pros..


"Robert Cummings" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Sat, 2004-11-06 at 21:44, Aalee wrote:
> > Hi there,
> > Is PHP an object oriented language. If not is it gonna be?
>
> Did you spend 10 seconds looking?
>
> Rob.
> --
> .------------------------------------------------------------.
> | InterJinn Application Framework - http://www.interjinn.com |
> :------------------------------------------------------------:
> | An application and templating framework for PHP. Boasting  |
> | a powerful, scalable system for accessing system services  |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for       |
> | creating re-usable components quickly and easily.          |
> `------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
On Sat, 2004-11-06 at 22:53, Aalee wrote:
> Yes of course...but was confused since some says it is so and some says it
> is not...So thought of asking the pros..

It is. PHP4 had limited support for OOP, though it was quite usable.
PHP5 goes further and provides pretty much everything else. See the
documentation on php.net for the complete language reference.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
Is PHP an object oriented language. If not is it gonna be?

PHP is not an object oriented language (like Java). Although PHP supports the creation of objects, you can still do pretty much everything without ever using OOP. I can't imagine PHP ever being turned into a true OO language, but I could be wrong on that.


Hope that helps,
Larry

--- End Message ---
--- Begin Message ---
Yes of course...but was confused since some says it is so and some says it
is not...So thought of asking the pros..

It is. PHP4 had limited support for OOP, though it was quite usable. PHP5 goes further and provides pretty much everything else. See the documentation on php.net for the complete language reference.

I guess this is where the OP's confusion stemmed from (Robert said Yes, I said No)! A liberal definition of OO is "An adjective applied to any system or language that supports the use of objects", under which PHP would qualify. But, in strict OO languages, everything must be done using objects. You can't even do a simple "Hello, World" without them (I could be wrong on this, of course). With that understanding PHP would not be OO.


So, in short, PHP __supports__ objects but does not __require__ them.

There's a good chance that 20 people will chime in now, with their own corrections.
Larry

--- End Message ---
--- Begin Message ---
On Sun, 2004-11-07 at 01:37, Larry E.Ullman wrote:
> >> Yes of course...but was confused since some says it is so and some 
> >> says it
> >> is not...So thought of asking the pros..
> >
> > It is. PHP4 had limited support for OOP, though it was quite usable.
> > PHP5 goes further and provides pretty much everything else. See the
> > documentation on php.net for the complete language reference.
> 
> I guess this is where the OP's confusion stemmed from (Robert said Yes, 
> I said No)! A liberal definition of OO is "An adjective applied to any 
> system or language that supports the use of objects", under which PHP 
> would qualify. But, in strict OO languages, everything must be done 
> using objects. You can't even do a simple "Hello, World" without them 
> (I could be wrong on this, of course). With that understanding PHP 
> would not be OO.
> 
> So, in short, PHP __supports__ objects but does not __require__ them.

For a language to be object oriented it does not need to be purist like
java. But then in counter to your argument, java primitive datatypes
such as int or bool are not themselves objects, which is in contrast to
the design of Smalltalk. At any rate, few would argue that C++ is not OO
and yet you can write a C++ program without using any objects. I think
it is sufficient to say that a language is OO if it supports the OO
paradigm, not if it enforces it.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message --- From a theoretical stand point, for a language to be OO, it should support encapsulation, inheritance and polymorphism

On Nov 7, 2004, at 2:26 AM, Robert Cummings wrote:

On Sun, 2004-11-07 at 01:37, Larry E.Ullman wrote:
Yes of course...but was confused since some says it is so and some
says it
is not...So thought of asking the pros..

It is. PHP4 had limited support for OOP, though it was quite usable. PHP5 goes further and provides pretty much everything else. See the documentation on php.net for the complete language reference.

I guess this is where the OP's confusion stemmed from (Robert said Yes,
I said No)! A liberal definition of OO is "An adjective applied to any
system or language that supports the use of objects", under which PHP
would qualify. But, in strict OO languages, everything must be done
using objects. You can't even do a simple "Hello, World" without them
(I could be wrong on this, of course). With that understanding PHP
would not be OO.


So, in short, PHP __supports__ objects but does not __require__ them.

For a language to be object oriented it does not need to be purist like
java. But then in counter to your argument, java primitive datatypes
such as int or bool are not themselves objects, which is in contrast to
the design of Smalltalk. At any rate, few would argue that C++ is not OO
and yet you can write a C++ program without using any objects. I think
it is sufficient to say that a language is OO if it supports the OO
paradigm, not if it enforces it.


Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message --- I'm trying to use some of the truetype fonts on my mac with PHP's "imagettfbbox()" routine but since all my fonts are contained within suitcases, I don't know how to get them to work. I found one non-suitcase TrueType font that loads fine so I know the basic mechanism works and the script has the correct permissions to access fonts. Anyone know how to use TrueType Suitcases with PHP?

Thanks for any help

Ken

--- End Message ---
--- Begin Message ---
I don't know if this will help you but you could try converting them.

Its hard to explain how to do .. but here is a start..

1) Burn the fonts to a Mac cd (burn the Cd for a mac.. not a PC.. if you do you will loose information)
2) Bring the cd to a windows machine and use MacDisk to read the cd. you can get macdisk from: macdisk.com
3) Grab the fonts off the Cd (using MacDisk)
4) Then use CrossFont (http://www.asy.com/) to convert them.


This maybe more work then its worth... but its one possible solution.

Thanks,
David


Ken Tozier wrote:
I'm trying to use some of the truetype fonts on my mac with PHP's "imagettfbbox()" routine but since all my fonts are contained within suitcases, I don't know how to get them to work. I found one non-suitcase TrueType font that loads fine so I know the basic mechanism works and the script has the correct permissions to access fonts. Anyone know how to use TrueType Suitcases with PHP?

Thanks for any help

Ken

--- End Message ---
--- Begin Message ---

On Nov 7, 2004, at 12:32 AM, David Schlotfeldt wrote:

I don't know if this will help you but you could try converting them.

Its hard to explain how to do .. but here is a start..

1) Burn the fonts to a Mac cd (burn the Cd for a mac.. not a PC.. if you do you will loose information)
2) Bring the cd to a windows machine and use MacDisk to read the cd. you can get macdisk from: macdisk.com
3) Grab the fonts off the Cd (using MacDisk)
4) Then use CrossFont (http://www.asy.com/) to convert them.


This maybe more work then its worth... but its one possible solution.

I don't own a PC and I'm developing for a dual G4 running OS 10.3. Would this type of conversion work when put back on a Mac?




Thanks, David


Ken Tozier wrote:
I'm trying to use some of the truetype fonts on my mac with PHP's "imagettfbbox()" routine but since all my fonts are contained within suitcases, I don't know how to get them to work. I found one non-suitcase TrueType font that loads fine so I know the basic mechanism works and the script has the correct permissions to access fonts. Anyone know how to use TrueType Suitcases with PHP?
Thanks for any help
Ken

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
I am opening a file and then have to look for a value inside the string. Is
there an easy way to do this? 

I need the value in this string for the var djLast = '45.119999';

 

<script Language=javascript
src="/DJCom/Includes/JavaScript/PortalStyle/bDetection.js"></script>

<SCRIPT Language="JavaScript">
// Prepare DJ Quote data
        var djLast = '45.119999';
        var djChange = '0.40';
        var djOpen = '44.639999';
        var djClose = '44.720001';
        var djVolume = '195700';
        var djDividend = '0.25';
        var djHigh = '45.23';
        var djLow = '44.549999';
        var djYrHigh = '52.799999';
        var djYrLow = '39.50'; 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.788 / Virus Database: 533 - Release Date: 11/1/2004
 

--- End Message ---
--- Begin Message ---
How can I calculate how many records I have in a table?
John

--- End Message ---
--- Begin Message ---
I might add, I do this, think there must be a better way?

 $mycounter = 0;
 while ($mydata = mysql_fetch_object($news))
 {
  $mycounter++;
 }

John Taylor-Johnston wrote:

> How can I calculate how many records I have in a table?
> John

--- End Message ---
--- Begin Message ---
You could do it in a SQL statement

SELECT COUNT(*) FROM table_name;

This is less system intensive.

David


John Taylor-Johnston wrote:
I might add, I do this, think there must be a better way?

 $mycounter = 0;
 while ($mydata = mysql_fetch_object($news))
 {
  $mycounter++;
 }

John Taylor-Johnston wrote:


How can I calculate how many records I have in a table?
John

--- End Message ---
--- Begin Message ---
Yeah definitely use COUNT(*) or mysql_num_rows() function.

Nate

-----Original Message-----
From: David Schlotfeldt [mailto:[EMAIL PROTECTED] 
Sent: Saturday, November 06, 2004 9:19 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: NMax

You could do it in a SQL statement

SELECT COUNT(*) FROM table_name;

This is less system intensive.

David


John Taylor-Johnston wrote:
> I might add, I do this, think there must be a better way?
> 
>  $mycounter = 0;
>  while ($mydata = mysql_fetch_object($news))
>  {
>   $mycounter++;
>  }
> 
> John Taylor-Johnston wrote:
> 
> 
>>How can I calculate how many records I have in a table?
>>John

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message --- count() is prefered over mysql_num_rows, because the later requires a full resultset to be tranfered, while the first doesn't.

(so, the 2nd is more resource intensive if you don't require the resultset)


[EMAIL PROTECTED] wrote:
Yeah definitely use COUNT(*) or mysql_num_rows() function.

Nate

-----Original Message-----
From: David Schlotfeldt [mailto:[EMAIL PROTECTED] Sent: Saturday, November 06, 2004 9:19 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: NMax


You could do it in a SQL statement

SELECT COUNT(*) FROM table_name;

This is less system intensive.

David


John Taylor-Johnston wrote:

I might add, I do this, think there must be a better way?

$mycounter = 0;
while ($mydata = mysql_fetch_object($news))
{
 $mycounter++;
}

John Taylor-Johnston wrote:



How can I calculate how many records I have in a table?
John



--- End Message ---
--- Begin Message ---
Hello All,


I am having an interesting syntax problem. :(
I have been battling this little bugger for the last week and a half, I have exhausted google and numerous php channels in that time.


I am starting to beleive it could be a syntax that is sofar un-documented or an unclear syntax limitation (read as: bug?).



PHP Version:
------------
PHP Version 5.1.0-dev
- And has been tested on numerous other builds/versions


Problem: --------

I am trying to access a static member of a class dynamically.
ie.

   $foo = 'className';
   echo $foo::$staticMember;


Example Code: -------------

<?php
// Define a class with a nice juicy static variable
class bob {
public static $type = 'safd';
}
// Lets chuck the name of the class into a variable...
$foo = 'bob';
// Just to show it all works lets do it manualllllly
echo bob::$type;
// This is the line with the well-wicked parse error on the double colon
echo $foo::$type;
?>



Note that the last line in this example code generated a syntax error:
Parse error: parse error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting ',' or ';' in /mnt/data0/www/twd/test.php on line 15
I'm aware that the current syntax is definately wrong, but for simplicity i think its a good example.


I think i have ruled out its an internal scoping issue within php by successfully using eval() to them same effect.
ie.
eval('echo '. $foo .'::$type;');









Thanks in advance for any Thoughts, Answers and Comments


Regards
Jake Press

--- End Message ---
--- Begin Message --- Jake, as you probably already know you usually have to give the class name when attempting to get a static variable, i.e.

YourClassName::$bob;

You *can* dynamically refer to a static class variable from within an object without knowing the name of the class; this is what self is for. i.e.

class YourClassName {
  function getStatic($var) {
    return self::$var;
  }
}

--- End Message ---
--- Begin Message ---
Jason Barnett wrote:

Jake, as you probably already know you usually have to give the class name when attempting to get a static variable, i.e.

YourClassName::$bob;

You *can* dynamically refer to a static class variable from within an object without knowing the name of the class; this is what self is for. i.e.

class YourClassName {
  function getStatic($var) {
    return self::$var;
  }
}

Hi Jason,

Thanks for your response. :)

That doesnt seem to be an answer at all applicable to my question tho...

Ofcourse i realise you need to give the class name when attempting to get a static variable...
heh... im sure it would be interesting referencing a class without its name :)


Yours Sincerely
Jake Press

--- End Message ---
--- Begin Message --- hi,
it's a limitation, and not allowed in PHP. There was a whole line of posts about it in internals.


- Tul

Jake Press wrote:
Hello All,


I am having an interesting syntax problem. :(
I have been battling this little bugger for the last week and a half, I have exhausted google and numerous php channels in that time.


I am starting to beleive it could be a syntax that is sofar un-documented or an unclear syntax limitation (read as: bug?).



PHP Version:
------------
PHP Version 5.1.0-dev
- And has been tested on numerous other builds/versions


Problem: --------

I am trying to access a static member of a class dynamically.
ie.

   $foo = 'className';
   echo $foo::$staticMember;


Example Code: -------------

<?php
// Define a class with a nice juicy static variable
class bob {
public static $type = 'safd';
}
// Lets chuck the name of the class into a variable...
$foo = 'bob';
// Just to show it all works lets do it manualllllly
echo bob::$type;
// This is the line with the well-wicked parse error on the double colon
echo $foo::$type;
?>


Note that the last line in this example code generated a syntax error:
Parse error: parse error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting ',' or ';' in /mnt/data0/www/twd/test.php on line 15
I'm aware that the current syntax is definately wrong, but for simplicity i think its a good example.


I think i have ruled out its an internal scoping issue within php by successfully using eval() to them same effect.
ie.
eval('echo '. $foo .'::$type;');









Thanks in advance for any Thoughts, Answers and Comments Regards
Jake Press

--- End Message ---
--- Begin Message ---
Hi,

I am trying to add "x" days to the current date for a calendar program that I 
am writing.  "x" represents any integer from 1 to 7.  So, for x=4, the program 
will get the current date

2004-11-06

and add 4 days to it:

2004-11-10

I need it to account for the next month if I want to add 4 days to 2004-11-29, 
so the result would be 2004-12-03, not 2004-11-33.  It would need the same 
functionality in moving the year to 2005-01-02 when I add 3 days to 2004-12-30. 
 

I hope that I've explained my objective clearly.  I have tried getting the date 
using

$today = date("Y-m-d");

and then trying to add "x" to it, but it only adds "x" to the year, not the day 
value.  So how can I get PHP to add "x" to the day value?  Any help would be 
awesome!  Thanks,

Matt

Matt Cassarino
206 484 4626
[EMAIL PROTECTED]
www.mattcass.com

--- End Message ---
--- Begin Message --- There are probably a lot of ways to solve this problem, but the way I would do it: create a timestamp out of whatever date you have, then add x * 24 * 60 * 60 to it and convert from the timestamp back into whatever string format date you want.
--- End Message ---
--- Begin Message ---
Matt Cassarino wrote:

Hi,

I am trying to add "x" days to the current date for a calendar program that I am writing. 
 "x" represents any integer from 1 to 7.  So, for x=4, the program will get the current 
date

2004-11-06

and add 4 days to it:

2004-11-10

I need it to account for the next month if I want to add 4 days to 2004-11-29, so the result would be 2004-12-03, not 2004-11-33. It would need the same functionality in moving the year to 2005-01-02 when I add 3 days to 2004-12-30.

I hope that I've explained my objective clearly.  I have tried getting the date 
using

$today = date("Y-m-d");


$timestamp = strtotime('+4 day', date()); // instead of date() you can also provide a different timestamp, for a different base-date
$in4days = date('Y-m-d', $timestamp);


and then trying to add "x" to it, but it only adds "x" to the year, not the day value. So how can I get PHP to add "x" to the day value? Any help would be awesome! Thanks,


Matt

Matt Cassarino
206 484 4626
[EMAIL PROTECTED]
www.mattcass.com

--- End Message ---
--- Begin Message --- I've spent the last 6 hours or so trying to get pspell going on my php install, version 4.3.9. I've searched all over the net, but haven't found a solution.

I'm using debian so I'm using the packaged version of php4 and apache. I installed aspell using apt-get and then downloaded and compiled pspell 0.12.2. I downloaded php4 off the php.net site and used it to compile a pspell.so file, which seemed to work until I tried to check a word. I get:

Warning: PSPELL couldn't open the dictionary. reason: I'm sorry I can't find any suitable word lists for the language-tag "en".

I can't find any dictionaries in the pkgdatadir which is /usr/local/share/pspell, although there are a few files in there such as:

cp1252.map      iso8859-15.map  iso8859-6.map  region-to-spelling.map
iso8859-1.map   iso8859-2.map   iso8859-7.map  viscii.map
iso8859-10.map  iso8859-3.map   iso8859-8.map
iso8859-13.map  iso8859-4.map   iso8859-9.map
iso8859-14.map  iso8859-5.map   koi8-r.map

My guess is it's looking for a .pwli file, which I have no idea how to get. I've even tried creating a link to my aspell dictionary:

ln -s /usr/lib/aspell/en-only.rws en_aspell.pwli

But this didn't help things at all.

Has anyone got their pspell going? Can any one help me with mine?
Thanks
Nick

--- End Message ---
--- Begin Message ---
Hey all,
Hope some of you also work on sundays :)
 
I have a little javascript which displays a images (with previous / next
thing)
Now, i populate the javascript array with an php array:
 
<SCRIPT LANGUAGE="JavaScript">
 
<!-- Begin
NewImg = new Array (
<?php
while($row = mysql_fetch_object($result)){
echo "\"".$row->picture_url."\",";
}
?>
"../pictures/7_stripper3.jpg",
"../pictures/7_stripper2.jpg"
);
var ImgNum = 0;
var ImgLength = NewImg.length - 1;
...
</script>
 
As you can see i echo the url of the picture.
After each picture url there needs to be a ','
But not after the last picture.
At this moment all pictures have the ',' after there url, even the last
one.
Any way to determine if the url is the url of the last picture and thus
not printing a ',' behind that last one?
 
Thx in advance,
 
Reinhart
 
  _____  

Reinhart Viane 
 <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED] 
Domos || D-Studio 
Graaf Van Egmontstraat 15/3 -- B 2800 Mechelen -- tel +32 15 44 89 01 --
fax +32 15 43 25 26 


STRICTLY PERSONAL AND CONFIDENTIAL 
This message may contain confidential and proprietary material for the
sole use of the intended 
recipient.  Any review or distribution by others is strictly prohibited.
If you are not the intended 
recipient please contact the sender and delete all copies.

 

--- End Message ---

Reply via email to