php-general Digest 12 Jul 2007 13:29:17 - Issue 4899
Topics (messages 258664 through 258688):
Re: PHP list as a blog
258664 by: Robert Cummings
Re: Checking Post Data against DB Data
258665 by: Chris
getting the next element of an associative array
258666 by: Olav
let's say we have the following associative array:
$array = array(
red = ferrari,
yellow = volkswagen,
green = mercedes,
blue = volvo
);
now: how do i get the key of the next array element (in this case green)?
$next = ?
Why not define your array with number index as well in the first
Olav Mørkrid wrote:
let's say we have the following associative array:
$array = array(
red = ferrari,
yellow = volkswagen,
green = mercedes,
blue = volvo
);
then we have a current index into the array:
$index = yellow;
$current = $array[$index];
now: how do i get the key of the next
Olav Mørkrid wrote:
let's say we have the following associative array:
$array = array(
red = ferrari,
yellow = volkswagen,
green = mercedes,
blue = volvo
);
then we have a current index into the array:
$index = yellow;
$current = $array[$index];
now: how do i get the key of the next
chris
for your suggestion to work, the internal array pointer of $array
would first have to be set to point to the current element ($index).
but how do you do this?
this may seem like childs play, but i actually can't find any
documented php function for this. it would be something like:
Olav Mørkrid wrote:
chris
for your suggestion to work, the internal array pointer of $array
would first have to be set to point to the current element ($index).
but how do you do this?
this may seem like childs play, but i actually can't find any
documented php function for this. it would be
yep, a for loop is the fallback i use now.
any reason why there isn't a built-in function for this?
any plans for it in future versions of php?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi Folks,
Is there a better way of doing the following:
$Rows[] = array();
$currentRow = count($Rows) - 1;
$Rows[$currentRow]['test'] = this is a test;
Specifically I am wonder if I can avoid having to use 'count'.
TIA,
JC
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
On Thu, 12 Jul 2007 18:45:36 +1000, John Comerford [EMAIL PROTECTED] wrote:
Hi Folks,
Is there a better way of doing the following:
$Rows[] = array();
$currentRow = count($Rows) - 1;
$Rows[$currentRow]['test'] = this is a test;
Specifically I am wonder if I can avoid having to use
Richard Lynch wrote:
On Wed, July 11, 2007 4:16 pm, Robert Cummings wrote:
But I'd have to say that the intent is not all that clear, really,
and
I'd be leery of this feature, personally.
I wouldn't be leery at all. It's been around for a very long time and
it's documented:
John Comerford wrote:
Hi Folks,
Is there a better way of doing the following:
$Rows[] = array();
$currentRow = count($Rows) - 1;
$Rows[$currentRow]['test'] = this is a test;
Specifically I am wonder if I can avoid having to use 'count'.
1) The code above will produce a $currentRow of -1
On Thu, 12 Jul 2007 18:45:36 +1000, John Comerford [EMAIL PROTECTED] wrote:
Hi Folks,
Is there a better way of doing the following:
$Rows[] = array();
$currentRow = count($Rows) - 1;
$Rows[$currentRow]['test'] = this is a test;
Specifically I am wonder if I can avoid having to use
2007. 07. 12, csütörtök keltezéssel 10.28-kor Stut ezt írta:
John Comerford wrote:
Hi Folks,
Is there a better way of doing the following:
$Rows[] = array();
$currentRow = count($Rows) - 1;
$Rows[$currentRow]['test'] = this is a test;
Specifically I am wonder if I can avoid
Zoltán Németh wrote:
2007. 07. 12, csütörtök keltezéssel 10.28-kor Stut ezt írta:
John Comerford wrote:
Hi Folks,
Is there a better way of doing the following:
$Rows[] = array();
$currentRow = count($Rows) - 1;
$Rows[$currentRow]['test'] = this is a test;
Specifically I am wonder if I can
[snip]
Mine was trying to go for an old funk song that starts:
What goes up, must come down.
Spinning wheel got to go 'round
Drop all the painted ponies by the riverside.
[mumble] let the spinning wheel slide.
Only later did I realize I broke the cardinal rule of Name That Tune
and have NO IDEA
Stut wrote:
Zoltán Németh wrote:
2007. 07. 12, csütörtök keltezéssel 10.28-kor Stut ezt írta:
John Comerford wrote:
Hi Folks,
Is there a better way of doing the following:
$Rows[] = array();
$currentRow = count($Rows) - 1;
$Rows[$currentRow]['test'] = this is a test;
Specifically I am
Hi,
I cannot do any operation wiht single quote like
explode(',$strContent);
Did I miss someting ?
Regards
Sancar
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Sancar Saran wrote:
Hi,
I cannot do any operation wiht single quote like
explode(',$strContent);
Did I miss someting ?
Regards
Sancar
what do you mean by 'cannot do' ?
If I do:
?php
$string = part1 ' part2;
print_r(explode(', $string));
it will return
Array(
[0] = part1
[1] =
Sancar Saran wrote:
I cannot do any operation wiht single quote like
explode(',$strContent);
Did I miss someting ?
In what way can't? What happens / doesn't happen?
-Stut
--
http://stut.net/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Hi,
I need a secure form. I have one here
http://www.edinburghnights.co.uk/pay/php/curl_https.html but it has no
algorithm check on the CC number. Also I need to make the form secure. Can
someone point me to an example or tutorial.
Many thanks,
R.
--
PHP General Mailing List
On Thursday 12 July 2007 15:11:28 Stut wrote:
Sancar Saran wrote:
I cannot do any operation wiht single quote like
explode(',$strContent);
Did I miss someting ?
In what way can't? What happens / doesn't happen?
-Stut
--
http://stut.net/
Hi,
Problem was
$strng = 'cInputI'
M. Sokolewicz wrote:
Stut wrote:
Zoltán Németh wrote:
2007. 07. 12, csütörtök keltezéssel 10.28-kor Stut ezt írta:
John Comerford wrote:
Hi Folks,
Is there a better way of doing the following:
$Rows[] = array();
$currentRow = count($Rows) - 1;
$Rows[$currentRow]['test'] = this is a test;
On Thu, 2007-07-12 at 09:58 +0100, Stut wrote:
Richard Lynch wrote:
On Wed, July 11, 2007 4:16 pm, Robert Cummings wrote:
But I'd have to say that the intent is not all that clear, really,
and
I'd be leery of this feature, personally.
I wouldn't be leery at all. It's been around for a
On Thursday 12 July 2007 15:11:28 Stut wrote:
Sancar Saran wrote:
I cannot do any operation wiht single quote like
explode(',$strContent);
Did I miss someting ?
Omg, It's my bad, sorry for lameness.
Before the exploding text I do some encoding decodings.
So? I do mis sequenced
Yes, TZ env var helps and it works when I use putenv().
However if I set TZ in the server, and restart apache/php, TZ is getting
wiped out.
I think my server admin and I have to do some poking around to figure
out why.
Thanks for the help.
-phil
-Original Message-
From: Richard Lynch
Can someone please help me?
I am new to installing and working with php and webservers. I am using
IIS 6.
I can not get php to load the ini file.
I have followed multiple guides including those listed on the install
pages and even went back and let the installer run, which changed
On 7/12/07, Ross [EMAIL PROTECTED] wrote:
Hi,
I need a secure form. I have one here
http://www.edinburghnights.co.uk/pay/php/curl_https.html but it has no
algorithm check on the CC number. Also I need to make the form secure. Can
someone point me to an example or tutorial.
Many thanks,
R.
On Thu, 2007-07-12 at 09:25 -0400, Karl Schmitt wrote:
Can someone please help me?
I am new to installing and working with php and webservers. I am using
IIS 6.
I can not get php to load the ini file.
Your webserver is looking for it here:
C:\WINDOWS\php.ini
Is it there?
Cheers,
On 7/12/07, Jay Blanchard [EMAIL PROTECTED] wrote:
[snip]
Mine was trying to go for an old funk song that starts:
What goes up, must come down.
Spinning wheel got to go 'round
Drop all the painted ponies by the riverside.
[mumble] let the spinning wheel slide.
Only later did I realize I broke
On Thu, 2007-07-12 at 15:47 +0300, Sancar Saran wrote:
On Thursday 12 July 2007 15:11:28 Stut wrote:
Sancar Saran wrote:
I cannot do any operation wiht single quote like
explode(',$strContent);
Did I miss someting ?
In what way can't? What happens / doesn't happen?
-Stut
Hi.
This may or may not be a PHP question - I'll let the group decide.
Note this URL:
http://www.someplace.com/SomeDirectory/SomeFile
compared to this URL:
http://www.someplace.com/SomeDirectory/SomeFile.php
Okay. How does one create the URL with no file extension? Is this
done through
Philip Thompson wrote:
Hi.
This may or may not be a PHP question - I'll let the group decide. Note
this URL:
http://www.someplace.com/SomeDirectory/SomeFile
compared to this URL:
http://www.someplace.com/SomeDirectory/SomeFile.php
Okay. How does one create the URL with no file extension?
Philip Thompson wrote:
This may or may not be a PHP question - I'll let the group decide. Note
this URL:
http://www.someplace.com/SomeDirectory/SomeFile
compared to this URL:
http://www.someplace.com/SomeDirectory/SomeFile.php
Okay. How does one create the URL with no file extension? Is
On 7/12/07, Philip Thompson [EMAIL PROTECTED] wrote:
Hi.
This may or may not be a PHP question - I'll let the group decide.
Note this URL:
http://www.someplace.com/SomeDirectory/SomeFile
compared to this URL:
http://www.someplace.com/SomeDirectory/SomeFile.php
Okay. How does one create the
On Thu, 12 Jul 2007 09:56:18 -0400, Daniel Brown [EMAIL PROTECTED] wrote:
On 7/12/07, Jay Blanchard [EMAIL PROTECTED] wrote:
[snip]
Mine was trying to go for an old funk song that starts:
What goes up, must come down.
Spinning wheel got to go 'round
Drop all the painted ponies by the
Thijs Lensselink wrote:
?
$evil[] = 6;
$evil[] = 6;
$evil[] = 6;
for($i=0;$icount($evil);$i++) {
$_ = sqrt($evil);
}
?
That also illustrates to newbies the allowance of using an
underscore as a variable. (Thank God it's almost Friday)
Thank _God_ it's Friday??? Covering all
John Comerford wrote:
Hi Folks,
Is there a better way of doing the following:
$Rows[] = array();
$currentRow = count($Rows) - 1;
$Rows[$currentRow]['test'] = this is a test;
I imagine that you are doing other actions between the above three lines?
Correct?
Really, the simplest way of doing
On 7/12/07, Colin Guthrie [EMAIL PROTECTED] wrote:
Thijs Lensselink wrote:
?
$evil[] = 6;
$evil[] = 6;
$evil[] = 6;
for($i=0;$icount($evil);$i++) {
$_ = sqrt($evil);
}
?
It was supposed to be money is the root of all evil, but the
code above wouldn't work correctly anyway, as
On 7/12/07, Daniel Brown [EMAIL PROTECTED] wrote:
On 7/12/07, Colin Guthrie [EMAIL PROTECTED] wrote:
Thijs Lensselink wrote:
?
$evil[] = 6;
$evil[] = 6;
$evil[] = 6;
for($i=0;$icount($evil);$i++) {
$_ = sqrt($evil);
}
?
It was supposed to be money is the root of all
On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote:
G... must be nice, some of us had to toil 18 hours a day sweeping
chimneys!
;)
Cheers,
Rob.
What do you mean us? Weren't you born before they invented the chimney?
--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile]
[snip]
?
$evil[] = 6;
$evil[] = 6;
$evil[] = 6;
for($i=0;$icount($evil);$i++) {
$_ = sqrt($evil);
}
?
It was supposed to be money is the root of all evil, but the
code above wouldn't work correctly anyway, as each time through the
for() loop it'll try to get the square
Fernando Cosso wrote:
Hi guys
I have been asked to create a php script. It has to create a pdf with the
qmail and the bandwidth statistics. My first approach was to parse the html
output of the isoqlog for the mail and copy the mrtg's images
But it is a really nasty job.
I wonder if someone has
On Thu, 2007-07-12 at 11:20 -0400, Daniel Brown wrote:
On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote:
G... must be nice, some of us had to toil 18 hours a day sweeping
chimneys!
;)
Cheers,
Rob.
What do you mean us? Weren't you born before they invented the chimney?
On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote:
On Thu, 2007-07-12 at 11:20 -0400, Daniel Brown wrote:
On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote:
G... must be nice, some of us had to toil 18 hours a day sweeping
chimneys!
;)
Cheers,
Rob.
What do you mean
This may or may not be a PHP question - I'll let the group decide. Note
this URL:
http://www.someplace.com/SomeDirectory/SomeFile
compared to this URL:
http://www.someplace.com/SomeDirectory/SomeFile.php
Okay. How does one create the URL with no file extension? Is this done
through PHP or
On Thu, 2007-07-12 at 11:27 -0400, Daniel Brown wrote:
On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote:
On Thu, 2007-07-12 at 11:20 -0400, Daniel Brown wrote:
On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote:
G... must be nice, some of us had to toil 18 hours a day sweeping
Robert Cummings wrote:
On Thu, 2007-07-12 at 11:20 -0400, Daniel Brown wrote:
On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote:
G... must be nice, some of us had to toil 18 hours a day sweeping
chimneys!
;)
Cheers,
Rob.
What do you mean us? Weren't you born before they invented
On 7/12/07, Tijnema [EMAIL PROTECTED] wrote:
You can probably remember the good old time of being a child and
having holiday ;)
Tijnema
--
Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info
Don't rub it in, Matijn ;-P
--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
On 7/12/07, Daniel Brown [EMAIL PROTECTED] wrote:
On 7/12/07, Tijnema [EMAIL PROTECTED] wrote:
You can probably remember the good old time of being a child and
having holiday ;)
Tijnema
--
Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info
Don't rub it in, Tijnema ;-P
On 7/12/07, Tijnema [EMAIL PROTECTED] wrote:
On 7/12/07, Daniel Brown [EMAIL PROTECTED] wrote:
On 7/12/07, Tijnema [EMAIL PROTECTED] wrote:
You can probably remember the good old time of being a child and
having holiday ;)
Tijnema
--
Vote for PHP Color Coding in Gmail! -
On Thu, 2007-07-12 at 17:06 +0200, Tijnema wrote:
On 7/12/07, Daniel Brown [EMAIL PROTECTED] wrote:
On 7/12/07, Colin Guthrie [EMAIL PROTECTED] wrote:
Thijs Lensselink wrote:
?
$evil[] = 6;
$evil[] = 6;
$evil[] = 6;
for($i=0;$icount($evil);$i++) {
$_ =
Daniel Brown wrote:
Did you come before or after the chicken egg?
Relevant to the above:
$a = array('Chicken','Egg');
echo The . $a[array_rand($a)] . comes first.;
I appologize if this one's already been done...I've only glanced at a
few entries in this thread, entertaining though it
On 7/12/07, Robert Cummings [EMAIL PROTECTED] wrote:
I wasn't born silly-ass, I was hatched. :)
Did you come before or after the chicken egg?
After the first one, but I fried it up and so earth had to wait another
couple of million years for a chicken to evolve again.
Ah, so then,
dear php developer,
i have weird situation here, i can't create a file in 777 mode directory
and stay in same server, is this a bug ??
fyi. i'm using fc6, and php 5.1.6
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On 7/12/07, Jon Anderson [EMAIL PROTECTED] wrote:
Daniel Brown wrote:
Did you come before or after the chicken egg?
Relevant to the above:
$a = array('Chicken','Egg');
echo The . $a[array_rand($a)] . comes first.;
I appologize if this one's already been done...I've only glanced at a
few
Anugrah Widya wrote:
dear php developer,
i have weird situation here, i can't create a file in 777 mode directory
and stay in same server, is this a bug ??
fyi. i'm using fc6, and php 5.1.6
I'm not sure I understand what the problem is. Please post the code
you're using and a more
On 7/12/07, Anugrah Widya [EMAIL PROTECTED] wrote:
dear php developer,
i have weird situation here, i can't create a file in 777 mode directory
and stay in same server, is this a bug ??
How are you attempting to create the file?
What do your PHP settings allow and disallow?
Do you
Stut wrote:
Anugrah Widya wrote:
dear php developer,
i have weird situation here, i can't create a file in 777 mode
directory and stay in same server, is this a bug ??
fyi. i'm using fc6, and php 5.1.6
I'm not sure I understand what the problem is. Please post the code
you're using and a
Anugrah Widya wrote:
Stut wrote:
Anugrah Widya wrote:
dear php developer,
i have weird situation here, i can't create a file in 777 mode
directory and stay in same server, is this a bug ??
fyi. i'm using fc6, and php 5.1.6
I'm not sure I understand what the problem is. Please post the
Hi all,
Am kind of confused between htmlspecialchars and htmlentities. I've got data i
need to display data on a page containing e.g. quot; but will like it to be
displayed as
htmlspecialchars or htmlentities or page character set ?
Cheers
-
Take
In news: [EMAIL PROTECTED] -
Karl Schmitt wrote :
Can someone please help me?
I am new to installing and working with php and webservers. I am
using IIS 6.
I can not get php to load the ini file.
I have followed multiple guides including those listed on the install
pages and even
Best way to learn, and remember, things like this is to make a simple test page
and see for yourself.
Don Don wrote:
Hi all,
Am kind of confused between htmlspecialchars and htmlentities. I've got data i need to
display data on a page containing e.g. quot; but will like it to be displayed
Don Don wrote:
Hi all,
Am kind of confused between htmlspecialchars and htmlentities. I've got data i need to
display data on a page containing e.g. quot; but will like it to be displayed as
htmlspecialchars or htmlentities or page character set ?
Cheers
I'm trying to setup a XSLT based web site.
I wasn't exactly sure about the flow of the whole system when data from
relational database is transferred to XML and in turn the data inputted
from the user is relayed back to the database through XML (or directly
to the database with PHP DB
string htmlentities ( string $string [, int $quote_style [, string $charset
[, bool $double_encode]]] )
This function is identical to htmlspecialchars() in all ways, except with
htmlentities(), all characters which have HTML character entity equivalents
are translated into these entities.
Brian,
I was experimenting late last year using PHP to send SMS messages. I think
there is a
lot of potential in the marketplace around SMS. But most of the phone
companies wouldnt
even talk to me and all i was trying to do was hit a development API to test
some code out.
im almost certain you
Sounds more like the mail server than PHP. Although weird anyway ! What mail
server are you using : local/remote, smtp/sendmail/qmail ?
Try using whatever method and send a mail through this server from outside
of PHP with the same problem parameters ? Does that work ? It should either
eliminate
I am currently running
PHP 5.1.4
Fedora Core 5
i'm trying to exectute the following test script.
?php
$to = '[EMAIL PROTECTED]';
$subject = 'the subject';
$message = 'body';
$headers = 'From: [EMAIL PROTECTED]' . \r\n .
'Reply-To: [EMAIL PROTECTED]' . \r\n .
'X-Mailer: PHP/' .
Hi all - I've been looking at a number of the commercial service
providers for bulk SMS messaging, most of whom have PHP APIs. But
since they are selling something they don't answer my question
Is there any (legal, legitimate) way to send an SMS message that can
be replied to the
Hi,
I am trying to describe why php short tags failed to work on a server...
here is my simplified explanation:
it had to do with the server settings... The short_open_tag directive
in php.ini was set to 0.
Do you think that is an ok way to describe the problem to a technically
literate
it had to do with the server settings... The short_open_tag directive
in php.ini was set to 0.
Do you think that is an ok way to describe the problem to a technically
literate non php coder?
Sure.
Additionally, is there a good reference on the net that explains the
differences between
Brian,
Here's another thing that would be nice: A web service to look up the
carrier for a cell number. That way you could simply send an email to
[EMAIL PROTECTED], though this would still be only a partial
solution. This is a lot harder now that numbers are transportable
between carriers.
Here's another thing that would be nice: A web service to look up the
carrier for a cell number. That way you could simply send an email to
[EMAIL PROTECTED], though this would still be only a partial
solution. This is a lot harder now that numbers are transportable
between carriers.
I
As you guys can probably guess from the question I'm still getting to
grips with some parts of php.
I had stripped down the code for my original post, maybe this will clear
things up a bit:
$Rows[] = array();
$currentRow = count($Rows) - 1;
$Rows[$currentRow]['test'] = this is a test;
Micky Hulse wrote:
Hi Chris, thanks for the quick reply. I appreciate your help.
Chris wrote:
Sure.
Thanks. :)
1 3 definitely. No idea how it's a security risk.
Ah, great. Thanks for clarification.
I probably mis-read the info about it being a security risk.
I should have said I'm
Hi Chris, thanks for the quick reply. I appreciate your help.
Chris wrote:
Sure.
Thanks. :)
1 3 definitely. No idea how it's a security risk.
Ah, great. Thanks for clarification.
I probably mis-read the info about it being a security risk.
Have a great day,
Cheers,
Micky
--
Wishlists:
It's gotten to the point where I pretty much view social networking
sites as just another form of spammers...
I blogged about it, and would like feedback from members of this
lists, for various reasons I would hope would be obvious.
PLEASE put responses in my blog, or your blog, or whatever, but
I have a simple page that displays a record from the sql server database. One
of the fields is a text field and keeps getting truncated at 3980 characters.
I searched and saw someone had reported this as a PDO bug so I'm not using PDO
anymore, but I'm still getting the truncation. Anyone
kelvin,
attached is a very simple diagram i put together when i got home
illustrating a possible relationship between the main components in an xsl
templated php application w/ a database back-end. as ive mentioned there
are other configurations as well. primarily the main options in the
[snip]
...schtuff
[/snip]
Please, do not cast aspersions upon the telcos, for those of us who work
in the industry cannot even get some of what you are talking about. We
have a vendor that provides the SMS part and they will not expose the
SMS API to us (not all SMS platforms are equal
80 matches
Mail list logo