I need to explode an array with an array.
$one = array(0 ='golf', 1 = 'field');
$two = array(0 = On the golf course or in the field of clover);
$array_exp = explode($one, $two);
print_r('pre');
print_r($array_exp);
print_r('/pre');
Notice: Array to string conversion.
I have done this before
$one = array(0 ='golf', 1 = 'field');
$two = array(0 = On the golf course or in the field of clover);
$array_exp = explode($one, $two);
What's the desired result?
array('golf' = On the golf course or in the field of clover,
'field' = On the golf course or in the field of clover)); ?
Marc
: Tuesday, May 17, 2011 7:52 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Explode Question
$one = array(0 ='golf', 1 = 'field');
$two = array(0 = On the golf course or in the field of clover);
$array_exp = explode($one, $two);
What's the desired result?
array('golf' = On the golf course
Message-
From: Marc Guay [mailto:marc.g...@gmail.com]
Sent: Tuesday, May 17, 2011 7:52 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Explode Question
$one = array(0 ='golf', 1 = 'field');
$two = array(0 = On the golf course or in the field of clover);
$array_exp = explode($one, $two
Message-
From: Marc Guay [mailto:marc.g...@gmail.com]
Sent: Tuesday, May 17, 2011 7:52 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Explode Question
$one = array(0 ='golf', 1 = 'field');
$two = array(0 = On the golf course or in the field of clover);
$array_exp = explode($one, $two
Subject: Re: [PHP] Explode Question
On 05/17/2011 07:53 PM, ad...@buskirkgraphics.com wrote:
The desired result is.
Array
(
[0] = On the;
[1] = course or in the;
[2] = of colver;
);
I am just not sure the delimiter can be an array in the Explode function.
Richard L
...@buskirkgraphics.com
Cc: 'Marc Guay'; php-general@lists.php.net
Subject: Re: [PHP] Explode Question
On 05/17/2011 07:53 PM, ad...@buskirkgraphics.com wrote:
The desired result is.
Array
(
[0] = On the;
[1] = course or in the;
[2] = of colver;
);
I am just not sure
At least not the way I expected it to. Apparently I am doing something
wrong, but I can't find anything specific that explains it. This is in
PHP 5.2.6.
Here is the sequence I am trying to implement without the database
portion. (This is typed in since the VNC I am using doesn't support
pasting
On Tue, Jun 23, 2009 at 12:11 PM, Bob McConnellr...@cbord.com wrote:
At least not the way I expected it to. Apparently I am doing something
wrong, but I can't find anything specific that explains it. This is in
PHP 5.2.6.
Here is the sequence I am trying to implement without the database
Ballard [mailto:aball...@gmail.com]
Sent: Tuesday, June 23, 2009 12:25 PM
To: Bob McConnell
Cc: php-general@lists.php.net
Subject: Re: [PHP] Explode-update-implode not working
On Tue, Jun 23, 2009 at 12:11 PM, Bob McConnellr...@cbord.com wrote:
At least not the way I expected it to. Apparently I am
Jim Lucas wrote:
Chris wrote:
Davi wrote:
Em Terça 05 Junho 2007 23:52, [EMAIL PROTECTED] escreveu:
That's exactly correct. Except I /think/ you should use \n instead of
'\n'.
Thank you for the reply... =)
I'll check this... BTW:
array explode ( string $delimiter, string $string [, int
At 6/5/2007 10:50 PM, Jim Lucas wrote:
Windows uses \r\n newlines; *nix uses \n; Mac uses \r.
...
PHP Code:
$txt = preg_replace('/\r\n|\r/', \n, $txt);
Another way to write that PCRE pattern is /\r\n?/ (one carriage
return followed by zero or one linefeed).
I recall also running into
Em Quarta 06 Junho 2007 02:50, Jim Lucas escreveu:
Chris wrote:
Davi wrote:
Em Terça 05 Junho 2007 23:52, [EMAIL PROTECTED] escreveu:
That's exactly correct. Except I /think/ you should use \n instead of
'\n'.
array explode ( string $delimiter, string $string [, int $limit] )
So,
Em Quarta 06 Junho 2007 10:54, Davi escreveu:
But... Why does it happen:
[code]
$object=mysql_fetch_object($result);
$texto = $object-texto;
$texto=preg_replace(/\r|\n/,,stripslashes($texto));
echo $texto;
[/code]
[output]
Teste
\r\nde formatação!
\r\nTudo funcionando...
\r\n
Davi wrote:
Em Quarta 06 Junho 2007 10:54, Davi escreveu:
But... Why does it happen:
[code]
$object=mysql_fetch_object($result);
$texto = $object-texto;
$texto=preg_replace(/\r|\n/,,stripslashes($texto));
echo $texto;
[/code]
[output]
Teste
\r\nde formatação!
\r\nTudo funcionando...
\r\n
Em Quarta 06 Junho 2007 13:20, Jim Lucas escreveu:
Davi wrote:
Em Quarta 06 Junho 2007 10:54, Davi escreveu:
But... Why does it happen:
[code]
$object=mysql_fetch_object($result);
$texto = $object-texto;
$texto=preg_replace(/\r|\n/,,stripslashes($texto));
echo $texto;
Hi all.
I've the fowlling string:
$_POST[my_text]=hi...\nthis is my multi-line\ntext;
Can I use explode to have something like:
$str[0]=hi...;
$str[1]=this is my multi-line;
$str[2]=text;
$str=explode($_POST[my_text],'\n');
TIA and sorry the *very* poor english.
--
Davi Vidal
[EMAIL
That's exactly correct. Except I /think/ you should use \n instead of '\n'.
On 6/5/07, Davi [EMAIL PROTECTED] wrote:
Hi all.
I've the fowlling string:
$_POST[my_text]=hi...\nthis is my multi-line\ntext;
Can I use explode to have something like:
$str[0]=hi...;
$str[1]=this is my multi-line;
Em Terça 05 Junho 2007 23:52, [EMAIL PROTECTED] escreveu:
That's exactly correct. Except I /think/ you should use \n instead of
'\n'.
Thank you for the reply... =)
I'll check this... BTW:
array explode ( string $delimiter, string $string [, int $limit] )
So, I was wrong...
The right way,
Davi wrote:
Em Terça 05 Junho 2007 23:52, [EMAIL PROTECTED] escreveu:
That's exactly correct. Except I /think/ you should use \n instead of
'\n'.
Thank you for the reply... =)
I'll check this... BTW:
array explode ( string $delimiter, string $string [, int $limit] )
So, I was wrong...
The
Em Quarta 06 Junho 2007 00:18, Chris escreveu:
Davi wrote:
Em Terça 05 Junho 2007 23:52, [EMAIL PROTECTED] escreveu:
That's exactly correct. Except I /think/ you should use \n instead of
'\n'.
So, I was wrong...
The right way, probaly, is:
$str=explode(\n,$_POST[my_text]);
If
Chris wrote:
Davi wrote:
Em Terça 05 Junho 2007 23:52, [EMAIL PROTECTED] escreveu:
That's exactly correct. Except I /think/ you should use \n instead of
'\n'.
Thank you for the reply... =)
I'll check this... BTW:
array explode ( string $delimiter, string $string [, int $limit] )
So, I
i have a mysql column that looks like this:
groups
---
12,7,10,6,14,11,2
is it possible to select the row if `groups` contain 7 or 14?
trying to avoid running two queries and running explode() on it.
i don't remember but i thought there was a way to use explode() on
something like this
2007. 04. 27, péntek keltezéssel 02.33-kor Sebe ezt írta:
i have a mysql column that looks like this:
groups
---
12,7,10,6,14,11,2
is it possible to select the row if `groups` contain 7 or 14?
you'd better put the groups info in a separate table, referenced by this
table. then you
At 4/26/2007 11:33 PM, Sebe wrote:
i have a mysql column that looks like this:
groups
---
12,7,10,6,14,11,2
is it possible to select the row if `groups` contain 7 or 14?
trying to avoid running two queries and running explode() on it.
I would think a more efficient strategy would be a
Paul Novitski wrote:
At 4/26/2007 11:33 PM, Sebe wrote:
i have a mysql column that looks like this:
groups
---
12,7,10,6,14,11,2
is it possible to select the row if `groups` contain 7 or 14?
trying to avoid running two queries and running explode() on it.
I would think a more efficient
-Original Message-
From: Paul Novitski [mailto:[EMAIL PROTECTED]
Sent: Friday, April 27, 2007 3:01 AM
To: php-general@lists.php.net
Subject: Re: [PHP] explode in mysql query
At 4/26/2007 11:33 PM, Sebe wrote:
i have a mysql column that looks like this:
groups
On Fri, April 27, 2007 1:33 am, Sebe wrote:
i have a mysql column that looks like this:
groups
---
12,7,10,6,14,11,2
is it possible to select the row if `groups` contain 7 or 14?
trying to avoid running two queries and running explode() on it.
i don't remember but i thought there was
Richard Lynch wrote:
On Tue, April 19, 2005 7:03 am, Jochem Maas said:
The 'other' guy mentioned that while() is faster than foreach,
is this true?
Don't know ; Don't care.
You should never loop through so many things in PHP that it matters in the
first place :-)
I read a few days ago somewhere
Sorry jocham, for you getting this twice.
I'd assume foreach is recommended because it lends to more readable
code. More readable code, is generally considered better code.
Personally I'd disagree and use while( list() = each() ), because it
doesn't create a copy of the array in memory,
explode by ,
$output1 = explode(,,$string);
use a loop and explode array $output1 by :
Hope this helps.
Saswat
On 4/18/05, Sebastian [EMAIL PROTECTED] wrote:
$string = '4:gaming,5:hardware,3:software,8:security';
what is the best way to explode then loop this string after its taken
Richard Lynch wrote:
On Mon, April 18, 2005 4:34 am, Sebastian said:
$string = '4:gaming,5:hardware,3:software,8:security';
$idcats = explode(',', $string);
while (list(, $idcat) = each($idcats)){
list($id, $cat) = explode(':', $idcat);
echo \$id = $idbr /\n;
echo \$cat = $catbr /\n;
}
The
On Tuesday 19 April 2005 17:03, Jochem Maas wrote:
Richard Lynch wrote:
On Mon, April 18, 2005 4:34 am, Sebastian said:
$string = '4:gaming,5:hardware,3:software,8:security';
$idcats = explode(',', $string);
while (list(, $idcat) = each($idcats)){
list($id, $cat) = explode(':',
Petar Nedyalkov wrote:
On Tuesday 19 April 2005 17:03, Jochem Maas wrote:
Richard Lynch wrote:
On Mon, April 18, 2005 4:34 am, Sebastian said:
$string = '4:gaming,5:hardware,3:software,8:security';
$idcats = explode(',', $string);
while (list(, $idcat) = each($idcats)){
list($id, $cat) =
On Tue, April 19, 2005 7:03 am, Jochem Maas said:
The 'other' guy mentioned that while() is faster than foreach,
is this true?
Don't know ; Don't care.
You should never loop through so many things in PHP that it matters in the
first place :-)
I read a few days ago somewhere on php.net that
$string = '4:gaming,5:hardware,3:software,8:security';
what is the best way to explode then loop this string after its taken apart.
output should be something like:
$id = 4
$cat = gaming
etc..
im just looking for the best/fastest way to do this. the string can grow to
200 or so bytes, maybe
On Monday 18 April 2005 14:34, Sebastian wrote:
$string = '4:gaming,5:hardware,3:software,8:security';
what is the best way to explode then loop this string after its taken
apart.
output should be something like:
$id = 4
$cat = gaming
etc..
im just looking for the best/fastest way to
On Mon, April 18, 2005 4:34 am, Sebastian said:
$string = '4:gaming,5:hardware,3:software,8:security';
$idcats = explode(',', $string);
while (list(, $idcat) = each($idcats)){
list($id, $cat) = explode(':', $idcat);
echo \$id = $idbr /\n;
echo \$cat = $catbr /\n;
}
what is the best way
Taking this code:
pre
?php
define (PATH_SEPARATOR, /);
$String=Root/One/Two/Three/Last;
$arr = explode ( PATH_SEPARATOR, $String );
var_dump ( $arr );
$arr = explode ( /, $String );
var_dump ( $arr );
?
/pre
It works fine in second case returing a five elements array, but in the
first one it
This constant is part of the directory functions.
See: http://www.php.net/manual/en/ref.dir.php
Araceli.
-Original Message-
From: Francisco M. Marzoa Alonso [mailto:[EMAIL PROTECTED]
Sent: Monday, November 15, 2004 5:18 PM
To: PHP-General
Subject: [PHP] explode and PATH_SEPARATOR
On Nov 15, 2004, at 10:17 AM, Francisco M. Marzoa Alonso wrote:
Taking this code:
pre
?php
define (PATH_SEPARATOR, /);
$String=Root/One/Two/Three/Last;
$arr = explode ( PATH_SEPARATOR, $String );
var_dump ( $arr );
$arr = explode ( /, $String );
var_dump ( $arr );
?
/pre
PATH_SEPARATOR is is a
I'm not new to PHP, but I have very little experience with arrays. I have comma
separated values in a database, that I need to pull out, explode into an array, then
check certain checkboxes if they exist.
I have two variables:
$x = 2,10,34
$y = 28,15,16
I need to explode them both, so that
HI,
--- Matt Winslow [EMAIL PROTECTED] wrote:
I'm not new to PHP, but I have very little
experience with arrays. I have comma separated
values in a database, that I need to pull out,
explode into an array, then check certain checkboxes
if they exist.
I have two variables:
$x =
* Thus wrote Matt Winslow:
I'm not new to PHP, but I have very little experience with arrays. I have comma
separated values in a database, that I need to pull out, explode into an array, then
check certain checkboxes if they exist.
I have two variables:
$x = 2,10,34
$y = 28,15,16
I
* Thus wrote zareef ahmed:
HI,
I have two variables:
$x = 2,10,34
$y = 28,15,16
I need to explode them both, so that the values of
$x are they keys, and the values of $y are the
values. Is that possible?
yes see array_combine function
http://www.php.net/array_combine
Hi all.
Is it possible to explode an array and have it exclude a certain
string. I currently have an array that is an ldapsearch that returns
sub-accounts of a parent account. These accounts are then displayed so
customer can either change the passwd or delete them.Thing is
ldapsearch
On Sat, 2004-02-07 at 03:09, Bobby R.Cox wrote:
Is it possible to explode an array and have it exclude a certain
string. I currently have an array that is an ldapsearch that returns
sub-accounts of a parent account. These accounts are then displayed so
customer can either change the
does anyone know how to do an explode where the separator is a linefeed?
--
Diana Castillo
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
PROTECTED]
Subject: [PHP] explode separate lines
does anyone know how to do an explode where the separator is a linefeed?
--
Diana Castillo
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net
Diana Castillo wrote:
does anyone know how to do an explode where the separator is a
linefeed?
You could try explode(\n, $stuff);, but if you are wanting to read
information from a file and store each line in an array, the file() function
does exactly that.
--
Burhan Khalid
Transmit Report:
To: [EMAIL PROTECTED], 402 Local User Inbox Full ([EMAIL PROTECTED])
---BeginMessage---
Diana Castillo wrote:
does anyone know how to do an explode where the separator is a
linefeed?
You could try explode(\n, $stuff);, but if you are wanting to read
information from a file
I am having a user enter a phrase into a textbox, and then I need to
seperate the words he has typed into variables so I can use each one
in an sql statement. I know I will use the explode() function to do this,
but how will I know how many variables I've created. For instance, if a
user
[snip]
I am having a user enter a phrase into a textbox, and then I need to
seperate the words he has typed into variables so I can use each one
in an sql statement. I know I will use the explode() function to do
this,
but how will I know how many variables I've created. For instance, if a
Any ideas how to do this,
I have a string
734088+3+734132+9+734138+80+781007+1+
I need to place the string into a multi-array like so
array[0][0] = 734088
array[0][1] = 3
array[1][0] = 734132
array[1][1] = 9
array[2][0] = 734138
array[2][1] = 80
etc...
Now ive tried everything i know any
[snip]
Any ideas how to do this,
I have a string
734088+3+734132+9+734138+80+781007+1+
I need to place the string into a multi-array like so
array[0][0] = 734088
array[0][1] = 3
etc...
Now ive tried everything i know any ideas?
[/snip]
start with explode
$arrString = explode(+,
Erin mailto:[EMAIL PROTECTED]
on Wednesday, November 12, 2003 9:13 AM said:
734088+3+734132+9+734138+80+781007+1+
I need to place the string into a multi-array like so
array[0][0] = 734088
array[0][1] = 3
[snip]
Now ive tried everything i know any ideas?
Yes. You need to somehow
Chris W. Parker
on Wednesday, November 12, 2003 9:19 AM said:
Without knowing any other way to do this I would use a regex to skip
the first + and change second one, repeating this until the end of the
string.
Considering Jay's answer for this question, do I always do things the
hard way
[snip]
Considering Jay's answer for this question, do I always do things the
hard way or what??
[/snip]
Young Grasshopper...there is more than one way to do things, a lot of
them are rightsome are just harder than others.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
Jay Blanchard wrote:
[snip]
Considering Jay's answer for this question, do I always do things the
hard way or what?? [/snip]
Young Grasshopper...there is more than one way to do things,
a lot of them are rightsome are just harder than others.
Isn't that the diplomatic equivalent of
Hello All,
I'm having trouble with this;
$rint1= rtrim($rintydata);
echo $rint1;
$rint2= explode(:, $rint1);
The data starts like this (from and email, there are many) ;
Time: November 9th 2003, 10:37AM - PST
IP Address: xx.xx.xxx.xxx
Browser Type: Opera/7.20 (Windows NT 5.1; U)
$rint1= rtrim($rintydata);
echo $rint1;
$rint2= explode(:, $rint1);
The data starts like this (from and email, there are many) ;
Time: November 9th 2003, 10:37AM - PST
IP Address: xx.xx.xxx.xxx
Browser Type: Opera/7.20 (Windows NT 5.1; U) [en]
Referer:
The problem is that when I do
Malcolm mailto:[EMAIL PROTECTED]
on Monday, November 10, 2003 9:13 AM said:
I can't figure out how to do an ereg that will replace just the
colon in Time nor can I find a way to make explode ignore it. This
may even be a completely wrong approach, any help would be
appreciated.
What
(after more and more discussion, this will be my first non-top post)
$rint1= rtrim($rintydata);
echo $rint1;
$rint2= explode(:, $rint1);
The data starts like this (from and email, there are many) ;
Time: November 9th 2003, 10:37AM - PST IP Address: xx.xx.xxx.xxx
Browser
Thanks to everyone who replied. I have taken the short route and
changed the source data.
I should have thought of that first I suppose.
Now I have a few existing records to edit but from now on I'll be
automagic.
On Mon, 10 Nov 2003 19:00:52 +0100, Wouter Van Vliet [EMAIL PROTECTED]
Hello,
I am using php to explode the lines of a text file (delimited by a
comma), break it into an array, and echo only one of the array elements.
I have accomplished all of this, but it only echos the text for one
line. How do I get php to scan multiple lines? I tried to introduce a
line
On 17 August 2003 08:34, Tom Rogers wrote:
Hi,
Sunday, August 17, 2003, 12:58:23 PM, you wrote:
$P1OC1Q1 = 1¶some text or some comment;
echo trtdYour score is: /tdtd;
$score=split($P1OC1Q1,¶); echo $score[0]./td/tr\n;
Do I have to go through all that to get score[0] ?
John
* Thus wrote John Taylor-Johnston ([EMAIL PROTECTED]):
$P1OC1Q1 = 1¶some text or some comment;
echo trtdYour score is: /tdtd; $score=split($P1OC1Q1,¶); echo
$score[0]./td/tr\n;
Do I have to go through all that to get score[0] ?
substr($P1OC1Q1, 0, strpos($P1OC1Q1, '¶')-1)
That will
Hi,
Sunday, August 17, 2003, 12:58:23 PM, you wrote:
JTJ $P1OC1Q1 = 1¶some text or some comment;
JTJ echo trtdYour score is: /tdtd; $score=split($P1OC1Q1,¶); echo
$score[0]./td/tr\n;
JTJ Do I have to go through all that to get score[0] ?
JTJ John
if the number is always first and an
$P1OC1Q1 = 1¶some text or some comment;
echo trtdYour score is: /tdtd; $score=split($P1OC1Q1,¶); echo
$score[0]./td/tr\n;
Do I have to go through all that to get score[0] ?
John
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Looks like a really simple piece of code except for the cryptic variable
names.
John Taylor-Johnston wrote:
$P1OC1Q1 = 1¶some text or some comment;
echo trtdYour score is: /tdtd; $score=split($P1OC1Q1,¶); echo $score[0]./td/tr\n;
Do I have to go through all that to get score[0] ?
John
Kind of hoping to do shorten it like this:
echo trtdYour score is: /tdtd.$score[0]=split($P1OC1Q1,¶)./td/tr\n;
No such hopes?
Looks like a really simple piece of code except for the cryptic variable names.
$P1OC1Q1 = 1¶some text or some comment;
echo trtdYour score is: /tdtd;
echo trtdYour score is: /tdtd; $score=split($P1OC1Q1,¶); echo
$score[0]./td/tr\n;
Do I have to go through all that to get score[0] ?
I think reset(split()) should work for getting the first element.
-
michal migurski- contact
Why not:
echo trtdYour score is:
/tdtd.split($P1OC1Q1,)./td/tr\n;
-Original Message-
From: John Taylor-Johnston [mailto:[EMAIL PROTECTED]
Sent: 17. ágúst 2003 03:48
To: [EMAIL PROTECTED]
Subject: Re: [PHP] [php] explode that :) !
Kind of hoping to do shorten it like this:
echo
Why not:
echo trtdYour score is:
/tdtd.split($P1OC1Q1,¶)./td/tr\n;
Ok, but what happens when $P1OC1Q1 = . It errors out.
$P1OC1Q1 = ;#left blank
$P1OC1Q2 = 1¶bunch of text;
$P1OC1Q3 = 1¶bunch of text;
$P1OC1Q4 = 1¶bunch of text;
$P1OC1Q5 = 1¶bunch of text;
$P1OC1Q6 = 1¶bunch of text;
--
: 17. ágúst 2003 03:48
To: [EMAIL PROTECTED]
Subject: Re: [PHP] [php] explode that :) !
Kind of hoping to do shorten it like this:
echo trtdYour score is:
/tdtd.$score[0]=split($P1OC1Q1,¶)./td/tr\n;
No such hopes?
Looks like a really simple piece of code except for the cryptic
variable
Hi all,
Suppose I have a long string like
$myStr = $string1:$string2:$string3;
I can obviously explode them using : as the separator. But what if
$string1 contains the character : by itself?
I was thinking, first I am gonna put an escaping character, so I can do
something like:
$string1 =
--- Reuben D. Budiardja [EMAIL PROTECTED] wrote:
Suppose I have a long string like
$myStr = $string1:$string2:$string3;
I can obviously explode them using : as the separator. But what if
$string1 contains the character : by itself?
You should strive to make your delimiter unique. A
On Friday 18 July 2003 02:42 pm, Chris Shiflett wrote:
--- Reuben D. Budiardja [EMAIL PROTECTED] wrote:
Suppose I have a long string like
$myStr = $string1:$string2:$string3;
I can obviously explode them using : as the separator. But what if
$string1 contains the character : by itself?
On Friday 18 July 2003 02:42 pm, Chris Shiflett wrote:
--- Reuben D. Budiardja [EMAIL PROTECTED] wrote:
Suppose I have a long string like
$myStr = $string1:$string2:$string3;
I can obviously explode them using : as the separator. But what if
$string1 contains the character : by
Reuben D. Budiardja wrote:
I did strive for that. But whatever character I choose, the problem remains
that we can't guarantee that it's going ot be only used as deliminater, since
the deliminated string is an input from user. So the problem remains.
Are you adding the delimiter? If so, maybe
One set of delimiters I often use for text files is ~~ or ^^. They are
fairly unique. If they do appear in a file then there is probably
garbage in the file and I want to know about. For my templates
delimiter I use {::TagName::}. You could use }::{ as your delimiter.
Don't limit yourself to
On Friday 18 July 2003 03:01 pm, you wrote:
On Friday 18 July 2003 02:42 pm, Chris Shiflett wrote:
--- Reuben D. Budiardja [EMAIL PROTECTED] wrote:
Suppose I have a long string like
$myStr = $string1:$string2:$string3;
I can obviously explode them using : as the separator. But
On Saturday 19 July 2003 03:04, Reuben D. Budiardja wrote:
You should strive to make your delimiter unique. A delimiter that might
possibly appear within the items it is meant to delimit is no longer a
delimiter.
I did strive for that. But whatever character I choose, the problem remains
load a bunch of characters into an array. Do a loop
through that array and check all of your $strings for
the current character in your loop. If the current
array character does not exist in any of them, you
have your delimiter.
I could put together an example if you want me to.
the string and delimit it yourself
Chris
- Original Message -
From: Reuben D. Budiardja [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, July 18, 2003 11:47 AM
Subject: [PHP] explode and escape character for string separator
Hi all,
Suppose I have a long string like
$myStr = $string1
From: Reuben D. Budiardja [EMAIL PROTECTED]
This is a hypothetical situation. The real situation is that I am trying
to
have a protocol for data sent by client using Flash. But the basic
question
remains.
So FLASH is creating the string that you must decode in PHP? Is there any
way to URL
conceivable that _
will get used.
RDB
Chris
- Original Message -
From: Reuben D. Budiardja [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, July 18, 2003 11:47 AM
Subject: [PHP] explode and escape character for string separator
Hi all,
Suppose I have a long string like
--- Reuben D. Budiardja wrote:
I did strive for that. But whatever character I choose, the problem
remains that we can't guarantee that it's going ot be only used as
deliminater, since the deliminated string is an input from user. So
the problem remains.
Well, just to point out, your
On Friday 18 July 2003 03:43 pm, CPT John W. Holmes wrote:
From: Reuben D. Budiardja [EMAIL PROTECTED]
This is a hypothetical situation. The real situation is that I am trying
to
have a protocol for data sent by client using Flash. But the basic
question
remains.
So FLASH is
Chris Shiflett wrote:
--- Reuben D. Budiardja wrote:
I did strive for that. But whatever character I choose, the problem
remains that we can't guarantee that it's going ot be only used as
deliminater, since the deliminated string is an input from user. So
the problem remains.
Well, just
Among other things, this is why XML exists. Use XML. FLASH can handle
it, PHP can handle it, everything out there can handle it. Use XML.
Delimiters will sooner or later break down. Use XML.
Over and out.
Grant Rutherford wrote:
Chris Shiflett wrote:
--- Reuben D. Budiardja wrote:
I
Reuben D. Budiardja [EMAIL PROTECTED] wrote:
Anything simple, and fast?
xml is simple, and fast to implement.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Thank you to those of you who helped me with my last problem earlier today.
Now I have a text file (setup.txt) that has a series of values all seperated by
\r\n's. Inside of another file I'm trying to read setup.txt into $rawSetupData and
explode that with \r\n's into an array called
why don't you just do this?
***
?php
if(file_exists(setup.txt)){
$lines=file(setup.txt);
echo stripslashes($lines[0]);
}
else echo Error opening \setup.txt\;
?
***
file() returns the file in an array, each line as new value, so line nr.
1 is $line[0], line nr. 2 is $line[1] etc...
I added
At 6/19/2003 10:41 PM, Kyle Babich wrote:
Inside of another file I'm trying to read setup.txt into $rawSetupData
and explode that with \r\n's
into an array called $setupData.
Why on earth?
http://us4.php.net/file
?php
if (file_exists(setup.txt)) {
$rawSetupData = readfile(setup.txt);
[EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, February 25, 2003 7:21 AM
Subject: [PHP] explode( , $pizza)
Off topic :) ?
Anyone know how to explode using javascript?
$pieces = explode( , $pizza);
John
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit
[mailto:[EMAIL PROTECTED]
Envoye : mardi 25 fevrier 2003 07:22
A : [EMAIL PROTECTED]
Objet : [PHP] explode( , $pizza)
Off topic :) ?
Anyone know how to explode using javascript?
$pieces = explode( , $pizza);
John
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe
Off topic :) ?
Anyone know how to explode using javascript?
$pieces = explode( , $pizza);
John
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi all:
I had tried to split the string into an array of
string using explode but the result isn't displaying
anything
I tried the example from document its its not showing
anything, pls point out where i went wrong
**
$pizaa=piece1 piece2 piece3 piece4 piece5 piece6;
$pieces
Because you can't spell pizza, I bet.
On Thu, 31 Oct 2002, ppf wrote:
Hi all:
I had tried to split the string into an array of
string using explode but the result isn't displaying
anything
I tried the example from document its its not showing
anything, pls point out where i went wrong
1 - 100 of 135 matches
Mail list logo