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...
Th
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",$_P
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 w
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 \n
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 [, i
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 f
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...
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/","",stripslash
Transmit Report:
To: [EMAIL PROTECTED], 402 Local User Inbox Full ([EMAIL PROTECTED])
--- Begin Message ---
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
> I have a string of 1034 and I want to have an array that has each number in
> an element.(ex: num[0] = 1, num[1] = 0, num[2] = 3 num[3] = 4) Is there a
> way to explode a string by each character?
Just convert it to a string: ie. $foo = (string)$num; echo $foo[1];
-Rasmus
--
PHP General M
If $string is a string, like :
$string = '312';
Then one can do :
$string[0]; // 3
$string[1]; // 1
$string[2]; // 2
Note, '312' is a string and will work using above but if we define 312 as
an integer like :
$string = 312;
Then $string[0] will not "work" and it'll need to
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 uni
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 chara
> 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 cont
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 yo
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 usi
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 r
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.
__
en rebuild 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
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
do I know
which "_" is my doing? Because in my case, it's faily conceivable that "_"
will get used.
RDB
> Chris
> - Original Message -
> From: "Reuben D. Budiardja" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent
--- 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 delim
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.
>
>
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 to
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 d
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
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 re
How can I assign automatically all fields of a database to a variable of
the same name?
Instead of having to manually do
$user_id=$row["user_id"];
etc
Then how could I know the number of fields in the table so I can do a
loop to print them all in html?
In advance, thanks for your help.
Alfredo
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 pa
: Baloo :0) [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 19, 2002 3:41 PM
To: [EMAIL PROTECTED]
Subject: [PHP] explode? (table field to a variable of same name)
How can I assign automatically all fields of a database to a variable of
the same name?
Instead of having to manually do
$user_id=$ro
First grab an associative array of the variables from the database with
mysql_fetch_array()
Then use extract($array); to extract all of the variables in the array
to the symbol table:
www.php.net/extract
Simon
Baloo :0) wrote:
>How can I assign automatically all fields of a database to a va
This may not be what you want to do, but should give you some hints.
(This is my code which I use to simply dump any SQL table into an HTML
table I can view in a browser ... for small tables, of course.)
Using MySQL as an example:
// assuming you ran a query and stored results in $mysql_result_s
This creates all the variables you asked for and also prints each one in a
column of a table.
foreach($row as $key=>$val) {
$$key = $val;
echo "$val";
}
-Rasmus
On Tue, 19 Feb 2002, Baloo :0) wrote:
> How can I assign automatically all fields of a database to a variable of
> the same n
oi ... typo! see below. sorry :(
~Chris
On Tue, 19 Feb 2002, Christopher William Wesley wrote:
> This may not be what you want to do, but should give you some hints.
> (This is my code which I use to simply dump any SQL table into an HTML
> table I can view in a browser ... for small
101 - 137 of 137 matches
Mail list logo