Re: phpsadness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Nathan,

Do you mean $x{8}?
That is good but not for all situations.
I  need sometimes to make an array with letters as keys and numbers as
values,  like  this  (I  give  English alphabet just as an example, so
please don't suggest str_split):
$alphabet="abcdefghijklmnopqrstuvwxyz";
// I wish that worked
$alphabet_array=explode('', $alphabet);
$letter_numbers=array_flip($alphabet_array);

this is just one case I encountered some time ago. Yes, I made this by
separating  letters with commas... but it's not the unique case when I
need it.
-- 
With best regards from Ukraine,
Andre
Skype: Francophile
My blog: http://oire.org/menelion (mostly in Russian)
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion

------------ Original message ------------
From: Nathan Nobbe <quickshiftin@xxxxxxxxx>
To: Robert Cummings
Date created: , 7:33:08 PM
Subject:  phpsadness


      On Sat, May 28, 2011 at 4:33 AM, Robert Cummings <robert@xxxxxxxxxxxxx>wrote:

> On 11-05-28 05:26 AM, Andre Polykanine wrote:
>
>> Hello Lester,
>>
>> Actually,  many of the points are not important for me so far, however
>> this one really drives me mad:
>> http://phpsadness.com/?page=sad/35   (can't   explode()  by  an  empty
>> string)
>> Besides that, he says nothing about unicode issues.
>> I  love  PHP  (I  really do, it's a neat language, as for me!), but it
>> *should* be unicode by default. If you ever read my code when I try to
>> make and strtr() with a unicode string, you'll understand me because I
>> do  an iconv(), then strtr() and then an iconv() back to unicode. That
>> is not a good coding practice, is it?
>>
>
> Isn't explode() with an empty string akin to division by zero?
>

Strings are already accessible through array notation anyway, seems like ol
dude may benefit from a php-general membership as well.

-nathan


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




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux