php-general Digest 5 Oct 2008 18:52:58 -0000 Issue 5719

2008-10-05 Thread php-general-digest-help

php-general Digest 5 Oct 2008 18:52:58 - Issue 5719

Topics (messages 281449 through 281450):

Re: AJAX and PHP
281449 by: Micah Gersten

First 30 characters of a strong
281450 by: Ron Piggott

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]


--
---BeginMessage---


Per Jessen wrote:
 Alain Roger wrote:

   
 So in this case what is the plus for companies like MS, Google (with
 Gmail), flicker and so on to use AJAX ?
 

 For them (and others), it's about the user experience, and ajax is good
 at enhancing the user experience. 

   
 it is on internet, so i guess they have a purpose to do that.
 mine is to have a responsive and intuitive interface application
 whatever it is on internet or intranet.
 

 Now you are changing the rules - they are very different on the
 internet.  My advice - don't use ajax in an attempt to reduce network
 traffic.  Use it to enhance the user experience.  Caching is much
 better at reducing network atraffic anyway.


 /Per Jessen, Zürich

   

If it's the size of the page itself that is large, caching does not help
as the HTML is pulled everytime if something is different.
As for AJAX, check out http://xajaxproject.org

It makes AJAX really easy to code.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com


---End Message---
---BeginMessage---
How do I display the first 5 characters of a string?  

$string=abcdefghijklmnopqrstuvwxyz;

my desired output is 

abcde

---End Message---


[PHP] First 30 characters of a strong

2008-10-05 Thread Ron Piggott
How do I display the first 5 characters of a string?  

$string=abcdefghijklmnopqrstuvwxyz;

my desired output is 

abcde


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



Re: [PHP] First 30 characters of a strong

2008-10-05 Thread Ashley Sheridan
On Sun, 2008-10-05 at 14:52 -0400, Ron Piggott wrote:
 How do I display the first 5 characters of a string?  
 
 $string=abcdefghijklmnopqrstuvwxyz;
 
 my desired output is 
 
 abcde
 
 

substr($string, 0, 5);


Ash
www.ashleysheridan.co.uk


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



[PHP] mt_rand() - the same forever?

2008-10-05 Thread Janek
I wonder whether I can rely on the stability of mt_srand() and
mt_rand(). I want them to generate the same sequence for a fixed seed,
regardless of PHP version. Do you think I can trust it?
Janek

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



Re: [PHP] mt_rand() - the same forever?

2008-10-05 Thread Richard Heyes
 I wonder whether I can rely on the stability of mt_srand() and
 mt_rand(). I want them to generate the same sequence for a fixed seed,
 regardless of PHP version. Do you think I can trust it?
 Janek

Keep in mind (if you're not already) that mt_rand() doesn't
technically need to be seeded.

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.phpguru.org/RGraph

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



Re: [PHP] mt_rand() - the same forever?

2008-10-05 Thread Janek
I know, but I *want* to seed it. My goal is to have a fixed
pseudorandom sequence for each integer (seed) and I don't want those
sequences to change regarding PHP version.

Janek

On Sun, Oct 5, 2008 at 9:52 PM, Richard Heyes [EMAIL PROTECTED] wrote:
 I wonder whether I can rely on the stability of mt_srand() and
 mt_rand(). I want them to generate the same sequence for a fixed seed,
 regardless of PHP version. Do you think I can trust it?
 Janek

 Keep in mind (if you're not already) that mt_rand() doesn't
 technically need to be seeded.

 --
 Richard Heyes

 HTML5 Graphing for FF, Chrome, Opera and Safari:
 http://www.phpguru.org/RGraph


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



Re: [PHP] mt_rand() - the same forever?

2008-10-05 Thread Ashley Sheridan
On Sun, 2008-10-05 at 21:57 +0200, Janek wrote:
 I know, but I *want* to seed it. My goal is to have a fixed
 pseudorandom sequence for each integer (seed) and I don't want those
 sequences to change regarding PHP version.
 
 Janek
 
 On Sun, Oct 5, 2008 at 9:52 PM, Richard Heyes [EMAIL PROTECTED] wrote:
  I wonder whether I can rely on the stability of mt_srand() and
  mt_rand(). I want them to generate the same sequence for a fixed seed,
  regardless of PHP version. Do you think I can trust it?
  Janek
 
  Keep in mind (if you're not already) that mt_rand() doesn't
  technically need to be seeded.
 
  --
  Richard Heyes
 
  HTML5 Graphing for FF, Chrome, Opera and Safari:
  http://www.phpguru.org/RGraph
 
 
Doesn't it also rely on the system clock as well?


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] mt_rand() - the same forever?

2008-10-05 Thread Janek
On Sun, Oct 5, 2008 at 10:05 PM, Ashley Sheridan
[EMAIL PROTECTED] wrote:
 On Sun, 2008-10-05 at 21:57 +0200, Janek wrote:
 I know, but I *want* to seed it. My goal is to have a fixed
 pseudorandom sequence for each integer (seed) and I don't want those
 sequences to change regarding PHP version.

 Janek

 On Sun, Oct 5, 2008 at 9:52 PM, Richard Heyes [EMAIL PROTECTED] wrote:
  I wonder whether I can rely on the stability of mt_srand() and
  mt_rand(). I want them to generate the same sequence for a fixed seed,
  regardless of PHP version. Do you think I can trust it?
  Janek
 
  Keep in mind (if you're not already) that mt_rand() doesn't
  technically need to be seeded.
 
  --
  Richard Heyes
 
  HTML5 Graphing for FF, Chrome, Opera and Safari:
  http://www.phpguru.org/RGraph
 

 Doesn't it also rely on the system clock as well?


 Ash
 www.ashleysheridan.co.uk



No. When I give a fixed seed to mt_srand(), each time I get the same
sequence of mt_rand()s. My question is wheather the actual algorithm
behind these functions is likely to change in the next version of PHP
or not.

Janek

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



Re: [PHP] mt_rand() - the same forever?

2008-10-05 Thread Jochem Maas
Janek schreef:
 On Sun, Oct 5, 2008 at 10:05 PM, Ashley Sheridan
 [EMAIL PROTECTED] wrote:
 On Sun, 2008-10-05 at 21:57 +0200, Janek wrote:
 I know, but I *want* to seed it. My goal is to have a fixed
 pseudorandom sequence for each integer (seed) and I don't want those
 sequences to change regarding PHP version.

 Janek

 On Sun, Oct 5, 2008 at 9:52 PM, Richard Heyes [EMAIL PROTECTED] wrote:
 I wonder whether I can rely on the stability of mt_srand() and
 mt_rand(). I want them to generate the same sequence for a fixed seed,
 regardless of PHP version. Do you think I can trust it?
 Janek
 Keep in mind (if you're not already) that mt_rand() doesn't
 technically need to be seeded.

 --
 Richard Heyes

 HTML5 Graphing for FF, Chrome, Opera and Safari:
 http://www.phpguru.org/RGraph

 Doesn't it also rely on the system clock as well?


 Ash
 www.ashleysheridan.co.uk


 
 No. When I give a fixed seed to mt_srand(), each time I get the same
 sequence of mt_rand()s. My question is wheather the actual algorithm
 behind these functions is likely to change in the next version of PHP
 or not.

not likely to change in the next version at all. but there is no guarantee that
somewhere down the road a new 'rand' algorythm won't be used either,
3 things to consider doing:

1. write your own php extension that copies the mt_srand() function as
it is now and use your extension's version of the function ... then you
can be sure it won't change.

2. ask the devs on [EMAIL PROTECTED] what they think the likelyhood
is that the output may change in the future.

3. pre-generate the sequences and store them, then use those pre-generated
sequences instead of using mt_srand() (obviously this may not be viable at all)

 
 Janek
 


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



[PHP] Politics

2008-10-05 Thread Amy

confronted gillion presently flakey expanded courses newsreader publicaccess 
storages

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



[PHP] Re:

2008-10-05 Thread huaizong wang
On Sun, Oct 5, 2008 at 1:00 PM, huaizong wang [EMAIL PROTECTED] wrote:



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