RE: [PHP-DEV] Just a little question (sidenote)

2002-11-19 Thread Derick Rethans
On Tue, 19 Nov 2002, John Coggeshall wrote:

> On a sidenote, is it possible in Zend to implmement something such as:
> 
> $string = "Foobar";
> $string = &$string[1];
> 
> I actually thought that would work, however upon testing it throws an
> error... Just curious.

No, this would not be possible to do, as a string in PHP is an 
continuues range of bytes, and not an array of 'character' zvals. 
Reference can only be made to zvals internally.

Derick

-- 

---
 Derick Rethans   http://derickrethans.nl/ 
 JDI Media Solutions
--[ if you hold a unix shell to your ear, do you hear the c? ]-


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




RE: [PHP-DEV] Just a little question (sidenote)

2002-11-19 Thread John Coggeshall
On a sidenote, is it possible in Zend to implmement something such as:

$string = "Foobar";
$string = &$string[1];

I actually thought that would work, however upon testing it throws an
error... Just curious.

John



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




RE: [PHP-DEV] Just a little question

2002-11-19 Thread Ford, Mike [LSS]
> -Original Message-
> From: Hacook [mailto:[EMAIL PROTECTED]]
> Sent: 19 November 2002 09:48
> 
> I have a chain charachter that look like this :
> *text*text*text*text*textetc
> I would like to cut off the FIRST star but not the others
> My chain is REALLY long.
> I made that script :
> 
> $maxi=strlen($resultats)-2;
> $nb = 0;
> while ($nb<=$maxi) {
> $results2 = $results2.$results[1+$nb];
> $nb = $nb+1;
> }
> 
> where $results is the chain
> It works perfectly but it takes over 5 minutes !
> Do you have any idea on how to make it faster ?

(a) wrong list -- you want [EMAIL PROTECTED]

(b) $results2 = substr($results, 1);

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




Re: [PHP-DEV] Just a little question

2002-11-19 Thread Andrey Hristov
$ar = array_diff(explode('*',$str), array());


Regards
Andrey


- Original Message - 
From: "Hacook" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 19, 2002 11:47 AM
Subject: [PHP-DEV] Just a little question


> Hi all,
> I have a chain charachter that look like this :
> *text*text*text*text*textetc
> I would like to cut off the FIRST star but not the others
> My chain is REALLY long.
> I made that script :
> 
> $maxi=strlen($resultats)-2;
> $nb = 0;
> while ($nb<=$maxi) {
> $results2 = $results2.$results[1+$nb];
> $nb = $nb+1;
> }
> 
> where $results is the chain
> It works perfectly but it takes over 5 minutes !
> Do you have any idea on how to make it faster ?
> Thanks,
> Hacook
> 
> 
> 
> -- 
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] Just a little question

2002-11-19 Thread Hacook
Hi all,
I have a chain charachter that look like this :
*text*text*text*text*textetc
I would like to cut off the FIRST star but not the others
My chain is REALLY long.
I made that script :

$maxi=strlen($resultats)-2;
$nb = 0;
while ($nb<=$maxi) {
$results2 = $results2.$results[1+$nb];
$nb = $nb+1;
}

where $results is the chain
It works perfectly but it takes over 5 minutes !
Do you have any idea on how to make it faster ?
Thanks,
Hacook



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