Re: Array syntax not covered in documentation

From: Date: Wed, 12 Mar 2003 16:25:30 +0000
Subject: Re: Array syntax not covered in documentation
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-139327@lists.php.net to get a copy of this message
> I want to do the following: > > $u=preg_replace("/[^$chars]/e",'"%".unpack("H2", > "$0")', $u); > > However, as you know, unpack returns an array. I tried this instead: > > $u=preg_replace("/[^$chars]/e",'"%".(unpack("H2", > "$0")[""])', $u); > > but that isn't syntactically correct. I know that this is possible to > remedy using a user function but I do this kind of thing very often > (grab the contents of an array value in one line of code) and want to be > able to do it without splitting it into multiple lines. Is that possible? What exactly are you trying to do? Can you explain it and give some same strings and output you're looking to achieve? ---John Holmes...

« previous php.general (#139327) next »