to get rid of potential double spaces after the explode, you could do:
foreach ($words as $word) {
if (!empty($word)) {
$first = $word;
break;
}
}
echo $first;
This will always return the first word.
Jordan
On Sep 20, 2005, at 7:24 AM, Jochem Maas wrote:
how much eas
- Original Message -
From: "Gustav Wiberg" <[EMAIL PROTECTED]>
To: "Jochem Maas" <[EMAIL PROTECTED]>
Cc: "PHP General"
Sent: Tuesday, September 20, 2005 3:04 PM
Subject: Re: [PHP] Easy question - delete strings from the beginning of
spac
- Original Message -
From: "Jochem Maas" <[EMAIL PROTECTED]>
To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Cc: "PHP General"
Sent: Tuesday, September 20, 2005 2:24 PM
Subject: Re: [PHP] Easy question - delete strings from the beginning of
space...
Gustav Wiberg wrote:
Hi there!
I guess this is an easy question. I have string...
"Hello you"
and I want to get the "Hello" part.
How do I do that? (I can of course search for first occurence of space
and then use substr, but I guess there is an easier solution?
how much easier do you want
Hi there!
I guess this is an easy question. I have string...
"Hello you"
and I want to get the "Hello" part.
How do I do that? (I can of course search for first occurence of space and
then use substr, but I guess there is an easier solution?
/G
http://www.varupiraten.se/
--
PHP General Mai
I've been going through a number of easy XML parsing examples on the
web, and they all have one thing in common: the XML is in a file, which
they read in 4K chunks and parse.
My application will be retrieving the XML from a web service,
presumably like $xml = file_get_contents($url). I was assu
On Tue, 2004-08-03 at 23:25, Robert Frame wrote:
> I am sure this is an obvious answer, but dang if I could find it.
>
> How do you chop off a decimal value in PHP? I know I can do it using a
> combination of modulus, subtraction and division, but isn't there a function
> that does this? I think
ook at our webhosting services, specializing in business web
hosting starting from $15 per month!
-Original Message-
From: Robert Frame [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 03, 2004 11:25 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Easy Question (I think)
I am sure this is an obvious a
I am sure this is an obvious answer, but dang if I could find it.
How do you chop off a decimal value in PHP? I know I can do it using a
combination of modulus, subtraction and division, but isn't there a function
that does this? I think I am suffering from a giant mental block =)
--
PHP Gener
Hi all,
I'm sure this question has come up before, so it should be an easy answer...
I'm running PHP as an apache module, and have safe_mode turned on.
When a script attempts to create a directory, or upload a file, it creates
it as the web server user.
Since it is an apache module, running suexe
> Sent: Tuesday, February 05, 2002 1:53 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Easy Question -- Show/ Hide text based on
> output of query
>
>
> On Wednesday 06 February 2002 02:53, Edward R. Bailey wrote:
> > Sorry -- Here it i
On Wednesday 06 February 2002 02:53, Edward R. Bailey wrote:
> Sorry -- Here it is
>
>
>$notes = " size=-1>Notes:";
>} else {
> $notes = "";
>}
> ?>
>
> Then I call $notes using --
>
> echo ($notes)
I meant your *whole* script -- never mind, have you tried ec
PROTECTED]
> Subject: Re: [PHP] Easy Question -- Show/ Hide text based on
> output of query
>
>
> On Wednesday 06 February 2002 02:38, Edward R. Bailey wrote:
> > I used echo($notes) at the bottom of the page and the
> output of $notes
> > prints reardless of whethe
On Wednesday 06 February 2002 02:38, Edward R. Bailey wrote:
> I used echo($notes) at the bottom of the page and the output of $notes
> prints reardless of whether or not the db field $memberNotes contains
> any data. It seems to me that $notes is always acting as if $memberNotes
> always contains
returns any data?
Thanks for your help,
ED
> -Original Message-
> From: Jason Wong [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 05, 2002 1:22 PM
> To: PHP General Mailing List
> Subject: Re: [PHP] Easy Question -- Show/ Hide text based on
> output of query
>
On Wednesday 06 February 2002 02:14, Edward R. Bailey wrote:
Please keep the discussion on the list!
> Thanks for responding! Yes the "memberNotes" database field only
> contains information in about a third of the records so I wanted to hide
> the entire field and label when their was no releve
On Wednesday 06 February 2002 00:03, Edward R. Bailey wrote:
> Hi,
>
> I am working on a page the displays the output of a query in a table and
> I only want to show the field labels that have corresponding output from
> the database. I am only really concerned with the last label in the
> table.
Hi,
I am working on a page the displays the output of a query in a table and
I only want to show the field labels that have corresponding output from
the database. I am only really concerned with the last label in the
table.
The label is called "Notes" and the corresponding field in the database
My Database functions are all wrapped up in an easy to use class. The
methods look something like this:
$db = new DB;
$q = "SELECT * FROM ATable";
$db->query($q);
while ($db->next_record()) {
$db->p("SomethingOrOther");
}
For the PHP script itself, the content management system I wrote up
On 06-Oct-2001 Chip wrote:
> When you write a php script to access a database,edit records, etc., is the
> entire thing 1 giant PHP page or a bunch of different ones? If it can be
> written both ways, which is the better way to do it?
>
I tend to write based on function:
userland.php
adminlan
> When you write a php script to access a database,edit records,
> etc., is the
> entire thing 1 giant PHP page or a bunch of different ones? If it can be
> written both ways, which is the better way to do it?
Using seperate files eases code maintenance and prevents parsing of
redundant code.
-
> When you write a php script to access a database,edit
> records, etc., is the entire thing 1 giant PHP page or a
> bunch of different ones?
A giant one
If it can be written both ways,
> which is the better way to do it?
Depends how big is your 'giant'.
It is all about your coding style
When you write a php script to access a database,edit records, etc., is the
entire thing 1 giant PHP page or a bunch of different ones? If it can be
written both ways, which is the better way to do it?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
2001 10:22 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Easy question...grabbing variables...
Um, been using PHP for awhile now and don' even know how to grab these:
http://wwbl.hyrum.net/send_email.php?to=4;from=25
I have usually only passed one variable before so all I've need
Um, been using PHP for awhile now and don' even know how to grab these:
http://wwbl.hyrum.net/send_email.php?to=4;from=25
I have usually only passed one variable before so all I've need to do is $toID=$to but
how do I get from? I know I should know this but I am either having a major brain
fa
proposed IF:
>> if(($fname) && ($lname) && ($email))
Alex:
> if (isset($fname) && isset($lname) && isset($email)) {
> echo "test";
> I believe the parens in your code don't do anything. anyway, best o' my
> knowledge that's the way to do it.
First IF tests whether the vars are 'true', Alex's
if(($fname) && ($lname) && ($email))
{ echo "test"; }
>
> Is there an easier way to write the IF line?
if (isset($fname) && isset($lname) && isset($email)) {
echo "test";
}
I believe the parens in your code don't do anything. anyway, best o' my
knowledge that's the way to do it.
"_)
-a
the only thing I can think of, would be to eliminate the () around
$fname, $lname, and $email
if they all test true in the first place, the () are kinda obsolete. :)
Nathan Cook wrote:
>
> I have always wrote code this like:
>
> if(($fname) && ($lname) && ($email))
> { echo "test";
Wed, 24 Jan 2001, Nathan Cook wrote:
> Date: Wed, 24 Jan 2001 16:27:12 -0700
> From: Nathan Cook <[EMAIL PROTECTED]>
> To: Php List <[EMAIL PROTECTED]>
> Subject: [PHP] easy question.
>
> I have always wrote code this like:
>
> if(($fname) && ($lna
I have always wrote code this like:
if(($fname) && ($lname) && ($email))
{ echo "test"; }
Is there an easier way to write the IF line?
Thank You
.:: Nathan Cook [ [EMAIL PROTECTED] ] ::.
Systems & Network Administrator :: Programmer
[ phone - 208.343.3110 ][ pager - 208.387.9983 ]
30 matches
Mail list logo