Re: spliting the elements in array

From: Date: Wed, 04 Jul 2007 09:26:16 +0000
Subject: Re: spliting the elements in array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-258228@lists.php.net to get a copy of this message
sivasakthi wrote:
Hi Guys, I have the array like below, squid %tu %tl %mt %>A test %st.%hs %>a %<m %tu %th %Hs %Ss test1 %tv %tr %Hs.%Ss %mt ............ In that i need to split the log name of each line, example : squid,test,test1 in to another array.. could you help me to find the solution? Thanks, Siva
What does your array look like _exactly_? ie. var_dump style output. Is it: array( array('squid', '%tu', '%tl', '%mt', '%>A'), array('test', '%st.%hs', '%>a', '%<m', '%tu', '%th', '%Hs', '%Ss') array('test1', '%tv', '%tr', '%Hs.%Ss', '%mt') ); or maybe it's: array( 'squid %tu %tl %mt %>A', 'test %st.%hs %>a %<m %tu %th %Hs %Ss', 'test1 %tv %tr %Hs.%Ss %mt' ); or maybe it's not even an array at all yet, but still a string, and you just misnamed it? (ie.) $not_quite_an_array = 'squid %tu %tl %mt %>A test %st.%hs %>a %<m %tu %th %Hs %Ss test1 %tv %tr %Hs.%Ss %mt'; Anyway, the answer heavily depends on what you actually have and want (exactly). Give us the expected _input_ and expected _output_ and we'll be able to help you; without those, we won't be. - Tul

« previous php.general (#258228) next »