echo ($pieces[2]);
instead of
echo ($pieces [2]);
Keith Vance
Vance Consulting LLC
www.vanceconsulting.net
(206) 355-2399
Try U.M.A. at http://uma.sourceforge.net/
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
And that too.
Keith Vance
Vance Consulting LLC
www.vanceconsulting.net
(206) 355-2399
Try U.M.A. at http://uma.sourceforge.net/
On Thu, 31 Oct 2002, Rasmus Lerdorf wrote:
Because you can't spell pizza, I bet.
On Thu, 31 Oct 2002, ppf wrote:
Hi all:
I had tried to split the string
]
Subject: [PHP] Explode and Trim
I am parsing through a text file and using explode to convert the
string to
an array. The problem seems to be at the end of the string, when I
check to
see if the last element in the array is empty it tells me that it is
not.
The problem comes because
Message-
From: Joshua E Minnie [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 1:07 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Explode and Trim
I am parsing through a text file and using explode to convert the
string to
an array. The problem seems to be at the end of the string
I am parsing through a text file and using explode to convert the string to
an array. The problem seems to be at the end of the string, when I check to
see if the last element in the array is empty it tells me that it is not.
The problem comes because the last element should be empty because all
-
From: Joshua E Minnie [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 1:07 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Explode and Trim
I am parsing through a text file and using explode to convert the
string to
an array. The problem seems to be at the end of the string, when I
check
Im trying to take this string, hello, and explode it into an array
with each cell in the array containing one character.
$array[0] = 'h'
$array[1] = 'e'
etc..
How does this work? When is use...
$character = explode('', $string) or
$character = explode($string)
...it doesn't seem to work.
On Wed, Mar 13, 2002 at 10:06:01PM -0500, Phil Schwarzmann wrote:
$array[0] = 'h'
$array[1] = 'e'
$character = explode('', $string) or
You need to explode the array:
$character = explode('', $array);
--Dan
--
PHP scripts that make your job easier
just use $string{0} and $string{1} , etc.
note the type of brackets
-Original Message-
From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 14, 2002 2:06 PM
To: [EMAIL PROTECTED]
Subject: [PHP] explode() - quick question
Im trying to take this string, hello
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
) [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=$row[user_id
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
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
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 td$val/td;
}
-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
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
$reqmonth = ${explode(-,$row[5])}[1];
Is there anyway I can get that to work without having to use multiple lines
of code?
list (,$reqmonth) = explode ('-', $row[5]);
--zak
- Original Message -
From: Adam Plocher [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, July 16, 2001 5:23 PM
Subject: [PHP] explode()
$reqmonth = ${explode(-,$row[5])}[1];
Is there anyway I can get that to work without having
On Mon, 16 Jul 2001 16:23:19 -0700, Adam Plocher
([EMAIL PROTECTED]) wrote:
$reqmonth = ${explode(-,$row[5])}[1];
Is there anyway I can get that to work without having to use
multiple lines
of code?
hmm... how about
$reqmonth = array_pop(explode(-,$row[5],2));
--
PHP General Mailing List
$arr = explode(-,$row[5]); $reqmonth=$arr[1];
Well, it's all on one line.
At 16:23 16/07/2001 -0700, Adam Plocher wrote:
$reqmonth = ${}[1];
Is there anyway I can get that to work without having to use multiple lines
of code?
-
Brian White
Step Two Designs Pty Ltd
Question about explode
this work just perfect
$name=what+ever;
$name1=explode(+,$name);
$fname=$name1[0] ;this has what
$lname=$name1[0] ;this has ever
But if I pass the info from another page like this
a href=whatever.php?name=what+evertest/a
How come I get this it does not make since
Makes perfect sense:
a href=whatever.php?name=what+evertest/a
Web browsers url encode form elements. If you use a href link like this,
you need to do the URL encoding yourself. A + happens to be a space, in
URL encoding.
So, PHP receives
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Richard Kurth) wrote:
$name=what+ever;
$name1=explode(+,$name);
$fname=$name1[0] ;this has what
$lname=$name1[0] ;this has ever
But if I pass the info from another page like this
a
Richard Kurth wrote:
Question about explode
this work just perfect
$name=what+ever;
$name1=explode(+,$name);
$fname=$name1[0] ;this has what
$lname=$name1[0] ;this has ever
But if I pass the info from another page like this
a
if you need to pass special characters (eg. +) in the url, you need to
use a url encoding function like rawurlencode().. or choose another
delimeter which can be passed in the url like these -_.
s
Richard Kurth wrote:
Question about explode
this work just perfect
$name=what+ever;
I figured out how to do it. Buy the way I am not the one passing the
variables like this this is how it is sent from a credit card company
when they send the customer back to my page. I am just trying to
capture that data so the customer does not have to put it in twice
nicole if you need
I have the following code that doesn't seem to explode. I'm trying to make
a field that looks like 21,23,25,27 or small,medium,large,x-large into a
pulldown menu with the individual item broken out.
if (($size != ) ($size != n/a)) {
$sizearry = explode(,, $size);
while (list($key,$value)
Hiya,
I have the following code that doesn't seem to explode. I'm trying to make
a field that looks like 21,23,25,27 or small,medium,large,x-large into a
pulldown menu with the individual item broken out.
if (($size != ) ($size != n/a)) {
$sizearry = explode(,, $size);
while
On Friday 27 April 2001 14:15, Tom Beidler wrote:
I have the following code that doesn't seem to explode. I'm trying to
make a field that looks like 21,23,25,27 or small,medium,large,x-large
into a pulldown menu with the individual item broken out.
if (($size != ) ($size != n/a)) {
How would I use to explode to extract the following
"name address city state zip"
I want to break that up and then do this
if (empty($name))
if (empty($address)
thanks
randy
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
Hello all,
I would like to check some names ( @ seperated strings) with this global $PHP_AUTH_USER
I first do
$arrLoginName = explode("@", $row-usr_loginName);
How can I construct a loop which stops and returns true if a match is found?
Any hints would be great.
Many thanks
Roland
Rol wrote:
Hello all,
I would like to check some names ( @ seperated strings) with this global
$PHP_AUTH_USER
I first do
$arrLoginName = explode("@", $row-usr_loginName);
How can I construct a loop which stops and returns true if a match is found?
Any hints would be great.
?php
function check()
{
$arrLoginName = explode("@", $row-usr_loginName);
foreach($arrLoginName as $pos = $val)
if (match)
return 1;
return ;
}
?
is this what you mean? please post regarding.
--
Chris Lee
Mediawaveonline.com
ph. 250.377.1095
ph.
Hello again,
I'd better explain better.
I have logon screen Header("WWW-Authenticate: Basic realm=\"whatever\"");
where I would like the compare the user name $PHP_AUTH_USER with the one in
my database
All names like Mike or mike are @ seperated strings
How can I check the names from this
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
101 - 135 of 135 matches
Mail list logo