please don't post this kind of question to internals. use [EMAIL PROTECTED]
Christopher Vogt schreef:
Hej,
I use PHP 5.2.6. I am refactoring some code to use more
object-orientation. I encounter a problem, where the new object-oriented
version results in a fatal error, where the old
Hej Jochem,
I understand there are many PHP beginners flooding the wrong lists with
the wrong questions, so I don't mind your harsh response. But I am not
one of them.
please don't post this kind of question to internals. use [EMAIL PROTECTED]
This was/is a question if something is worth a
Christopher Vogt schreef:
Hej Jochem,
I understand there are many PHP beginners flooding the wrong lists with
the wrong questions, so I don't mind your harsh response. But I am not
one of them.
I disagree. this kind of thing belongs on php-general (and lets keep it on list
please), if you
W liście Christopher Vogt z dnia poniedziałek 17 listopada 2008:
I have a good understanding of OOP. This is not a start for me. I am
just refactoring existing PHP code to be object-oriented. You say there
are plenty of reasons for a Fatal error, so please tell me a few, so I
understand the
Hi,
i'm on PHP training and our lector is telling us that to avoid counting an
array item amout thanks count($my_array), he tells we can do:
while($my_array)
{
... do something
}
but from experience this is an infinity loop...
it should be always something like
$count = count($my_array);
On 17 Nov 2008, at 13:01, Alain Roger wrote:
i'm on PHP training and our lector is telling us that to avoid
counting an
array item amout thanks count($my_array), he tells we can do:
while($my_array)
{
... do something
}
but from experience this is an infinity loop...
it should be always
Hi,
i'm on PHP training and our lector is telling us that to avoid counting an
array item amout thanks count($my_array), he tells we can do:
while($my_array)
{
... do something
}
but from experience this is an infinity loop...
it should be always something like
$count = count($my_array);
johny why wrote:
- Tasks
$60 reward to walk me through a successful Eclipse PHP debug session of
doProject on my IIS server.
The only task here is to get a debug session going.
There will not be any IIS support or PHP programming involved.
Should only be some basic config settings in
[snip]
...foreach...
[/snip]
You could also use a for loop if you wanted to count;
for($i = 0; $i count($array); $i++){
echo $i . \n;
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
...but for best performance you should do:
$counter = count($array);
for($i = 0; $i $counter; $i++){
echo $i . \n;
}
So the expression count() in the for()-loop is only
parsed once and not every loop.
Regards
Timo
[snip]
...foreach...
[/snip]
You could also use a for loop if you wanted
Timo Erbach schreef:
...but for best performance you should do:
$counter = count($array);
for($i = 0; $i $counter; $i++){
echo $i . \n;
}
just for fun:
$a = range(1,10);
for ($i = 0, $c = count($a); $i $c; print($a[$i].\n), $i++);
... gives an idea of the power and flexibility of a
Alain Roger wrote:
Hi,
i'm on PHP training and our lector is telling us that to avoid counting an
array item amout thanks count($my_array), he tells we can do:
while($my_array)
{
... do something
}
but from experience this is an infinity loop...
it should be always something like
$count =
I was wondering if anyone sees something I am bypassing:
I have this sample code that works in another server:
?php
function getClientFullName($dbh,$id){
// die(var_dump($dbh));
$sql = SELECT * FROM Clients WHERE Id=.$id;
// die(print $sql);
$sthr = $dbh-query($sql);
//
Jochem Maas wrote:
$a = range(1,10);
for ($i = 0, $c = count($a); $i $c; print($a[$i].\n), $i++);
think the point of this is to count the items in an array without count
mate :p no point in the above you could just:
$c = count($a);
foreach!
$a = range(1,10);
$c = 0;
foreach($a as $b) {
Thodoris wrote:
I was wondering if anyone sees something I am bypassing:
I have this sample code that works in another server:
?php
function getClientFullName($dbh,$id){
// die(var_dump($dbh));
$sql = SELECT * FROM Clients WHERE Id=.$id;
// die(print $sql);
$sthr =
-Original Message-
From: tedd [mailto:[EMAIL PROTECTED]
Sent: Saturday, November 15, 2008 2:11 PM
To: php-general@lists.php.net
Subject: [PHP] Another question about Google maps
Hi gang:
I posted this question on the Google Map Discussion group/list
thingie, but got zip in
Nathan Rixham schreef:
Jochem Maas wrote:
$a = range(1,10);
for ($i = 0, $c = count($a); $i $c; print($a[$i].\n), $i++);
think the point of this is to count the items in an array without count
mate :p no point in the above you could just:
$c = count($a);
I thought the point was to avoid
Richard Heyes wrote:
...
And you might also be interested in func_get_args(), which returns an
array of args passed to the function (don't know what it does if used
outside a function. Probably get an error).
yup..
bWarning/b: func_get_args(): Called from the global scope - no
function
On 17 Nov 2008, at 14:31, Nathan Rixham wrote:
if you really want a challenge try this one..
task: add the numbers 5 and 17 together, using php, without using
the + operator. fill it in:
function add($a , $b) {
//code here but no + - / * operators
return $answer;
}
echo add(5, 17);
On Mon, Nov 17, 2008 at 9:47 AM, Jochem Maas [EMAIL PROTECTED] wrote:
Nathan Rixham schreef:
Jochem Maas wrote:
$a = range(1,10);
for ($i = 0, $c = count($a); $i $c; print($a[$i].\n), $i++);
think the point of this is to count the items in an array without count
mate :p no point in the
Stut wrote:
On 17 Nov 2008, at 14:31, Nathan Rixham wrote:
if you really want a challenge try this one..
task: add the numbers 5 and 17 together, using php, without using the
+ operator. fill it in:
function add($a , $b) {
//code here but no + - / * operators
return $answer;
}
echo add(5,
Thodoris wrote:
I was wondering if anyone sees something I am bypassing:
I have this sample code that works in another server:
?php
function getClientFullName($dbh,$id){
// die(var_dump($dbh));
$sql = SELECT * FROM Clients WHERE Id=.$id;
// die(print $sql);
$sthr =
hi t!!
strace is something i would have used.. but unfortunately, strace (at least as
far as i can tell) doesn't work with web based apps...
thanks
-Original Message-
From: Thodoris [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 16, 2008 11:42 PM
To: Andrew Ballard
Cc: bruce;
Thodoris wrote:
I was wondering if anyone sees something I am bypassing:
I have this sample code that works in another server:
?php
function getClientFullName($dbh,$id){
// die(var_dump($dbh));
$sql = SELECT * FROM Clients WHERE Id=.$id;
// die(print $sql);
$sthr =
hi t!!
strace is something i would have used.. but unfortunately, strace (at least as
far as i can tell) doesn't work with web based apps...
thanks
-Original Message-
From: Thodoris [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 16, 2008 11:42 PM
To: Andrew Ballard
Cc: bruce;
On Sun, Nov 16, 2008 at 1:18 PM, Yeti [EMAIL PROTECTED] wrote:
I guess Canadians are slower, eh? :-)
LOL
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Only cuz it colder here!
--
Bastien
Cat, the other other white meat
At 8:37 AM -0600 11/17/08, Boyd, Todd M. wrote:
tedd, I think it might be displaying your extra divs (if there are any..
just skimmed the source momentarily) for a split second before they are
hidden with Javascript. Maybe try setting the CSS for your 3 map divs
(mapsearch, idlediv, searchdiv or
$smont = 10;
$sday = 13;
$syear = 2008;
$timestamp = mktime(0,0,0,$smont,$sday,$syear);
$thismonth = getdate($timestamp);
Here is where the problem comes into play.
echo $thismonth['yday'];
This displays 286 when in fact its 287.
Is there a problem in my ini file or what is the deal.
--
PHP
On Fri, Nov 14, 2008 at 8:13 PM, Daniel Kolbo [EMAIL PROTECTED] wrote:
Hello,
I am trying to do something like the following:
?php
function hello($var1 = 'default1', $var2 = 'default2') {
echo $var1:$var2;
}
$func= hello;
$args = 'yo','bob';
$func($args);
?
I understand why this
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2008 10:50 AM
To: php-general@lists.php.net
Subject: [PHP] Date Issue
$smont = 10;
$sday = 13;
$syear = 2008;
$timestamp = mktime(0,0,0,$smont,$sday,$syear);
$thismonth =
yup..
bWarning/b: func_get_args(): Called from the global scope - no
function context
Doesn't the name of the function give you a clue as to its use? You
need to call it inside a function.
--
Richard Heyes
HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org (Updated
At 2:25 PM + 11/17/08, Nathan Rixham wrote:
sounds like a poor teacher
It's more likely a poor student who wants us to answer the questions,
but hasn't the time to investigate the answer OR write a question
more correctly himself.
Cheers,
tedd
--
---
http://sperling.com
Shiplu wrote:
How to match accented characters by preg match?? I need to match Sin
garantía by /([^]+)/ but its capturing only Sin garant
Any idea?
convert to utf8 and use the U modifier on the regex string?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
How to match accented characters by preg match?? I need to match Sin
garantía by /([^]+)/ but its capturing only Sin garant
Any idea?
--
Blog: http://talk.cmyweb.net/
Follow me: http://twitter.com/shiplu
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Boyd, Todd M. wrote:
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2008 10:50 AM
To: php-general@lists.php.net
Subject: [PHP] Date Issue
$smont = 10;
$sday = 13;
$syear = 2008;
$timestamp = mktime(0,0,0,$smont,$sday,$syear);
$thismonth =
Nathan Rixham wrote:
Shiplu wrote:
How to match accented characters by preg match?? I need to match Sin
garantía by /([^]+)/ but its capturing only Sin garant
Any idea?
convert to utf8 and use the U modifier on the regex string?
sorry.. lowercase u for utf8! (U is ungreedy)
--
PHP General
On Mon, 2008-11-17 at 14:54 +, Stut wrote:
On 17 Nov 2008, at 14:31, Nathan Rixham wrote:
if you really want a challenge try this one..
task: add the numbers 5 and 17 together, using php, without using
the + operator. fill it in:
function add($a , $b) {
//code here but no + -
curious qiestion
to all on here who dabble in php... how many of you have actully gone to
college, taken algorithm courses, microprocessor courses,
design/architecture courses, etc..
or is the majority of the work here from people who've grabbed the tools and
started programming... ?
Robert Cummings schreef:
On Mon, 2008-11-17 at 14:54 +, Stut wrote:
On 17 Nov 2008, at 14:31, Nathan Rixham wrote:
if you really want a challenge try this one..
task: add the numbers 5 and 17 together, using php, without using
the + operator. fill it in:
function add($a , $b) {
On Mon, 2008-11-17 at 10:00 -0800, bruce wrote:
curious qiestion
to all on here who dabble in php... how many of you have actully gone to
college, taken algorithm courses, microprocessor courses,
design/architecture courses, etc..
or is the majority of the work here from people who've
On Mon, 2008-11-17 at 19:07 +0100, Jochem Maas wrote:
Robert Cummings schreef:
On Mon, 2008-11-17 at 14:54 +, Stut wrote:
On 17 Nov 2008, at 14:31, Nathan Rixham wrote:
if you really want a challenge try this one..
task: add the numbers 5 and 17 together, using php, without using
-Original Message-
From: bruce [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2008 12:00 PM
To: 'Robert Cummings'; 'Stut'
Cc: 'Nathan Rixham'; php-general@lists.php.net
Subject: RE: [PHP] while-question
curious qiestion
to all on here who dabble in php... how many of
On Mon, 2008-11-17 at 11:54 -0500, Shiplu wrote:
On Fri, Nov 14, 2008 at 8:13 PM, Daniel Kolbo [EMAIL PROTECTED] wrote:
Hello,
I am trying to do something like the following:
?php
function hello($var1 = 'default1', $var2 = 'default2') {
echo $var1:$var2;
}
$func= hello;
bruce wrote:
curious qiestion
to all on here who dabble in php... how many of you have actully gone to
college, taken algorithm courses, microprocessor courses,
design/architecture courses, etc..
or is the majority of the work here from people who've grabbed the tools and
started
who says PHP means programming?
All I see is script code, unless you write your own extension or you
contribute to php-internal
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
At 10:00 AM -0800 11/17/08, bruce wrote:
curious qiestion
to all on here who dabble in php... how many of you have actully gone to
college, taken algorithm courses, microprocessor courses,
design/architecture courses, etc..
or is the majority of the work here from people who've grabbed the
At 11:23 AM -0800 11/17/08, Yeti wrote:
who says PHP means programming?
Who says it doesn't?
I can program with rocks -- and do a good job of it. I can make a one
that can stand for a couple of thousand years.
Show me code that can last longer.
Cheers,
tedd
--
---
On Mon, 2008-11-17 at 11:23 -0800, Yeti wrote:
who says PHP means programming?
All I see is script code, unless you write your own extension or you
contribute to php-internal
http://en.wikipedia.org/wiki/Computer_program
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating
-Original Message-
From: Yeti [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2008 1:23 PM
To: Boyd, Todd M.; PHP General Mailing List
Subject: Re: [PHP] Experience (was: while-question)
who says PHP means programming?
All I see is script code, unless you write your own
Ok, ok I admit it. PHP is a programming language. I guess I drank too
much assembly code today.
By the way ... Motorola 68000! Those were to good old days.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Dabbling?
I think that making a living from it isn't dabbling, so I may not be
qualified to speak for the dabblers.
But for me, I was writing code before there were such courses. Later,
when I went to college I was taught adventures in keypunching and
received several next to
On 17 Nov 2008, at 19:43, Yeti wrote:
Ok, ok I admit it. PHP is a programming language. I guess I drank too
much assembly code today.
By the way ... Motorola 68000! Those were to good old days.
And my penis is way bigger than yours, but I digress.
Seriously tho, I define programming /
At 8:20 PM + 11/17/08, Stut wrote:
On 17 Nov 2008, at 19:43, Yeti wrote:
Ok, ok I admit it. PHP is a programming language. I guess I drank too
much assembly code today.
Seriously tho, I define programming / coding / software development
as writing instructions for a computer to follow. I
At 2:55 PM -0500 11/17/08, Wolf wrote:
Tedd, glad you got hooked on Phonics. One of these days I hope from
graduating from just looking at the pictures, but right now the
pictures are oh so enticing!. ;)
Wolf
Wolf:
Lot's of exciting things -- hard to keep up on bots, automated
buying,
Help I inherited this script and just found that its not inserting anything
into the workorderform table in the db, and I'm getting implode() errors
for the 'bannersize' isset line
New and need help in over my head:
here is the code:
?php
include(inc/dbconn_open.php);
if
On Mon, 2008-11-17 at 20:20 +, Stut wrote:
On 17 Nov 2008, at 19:43, Yeti wrote:
Ok, ok I admit it. PHP is a programming language. I guess I drank too
much assembly code today.
By the way ... Motorola 68000! Those were to good old days.
And my penis is way bigger than yours, but
Alain Roger wrote:
Hi,
i'm on PHP training and our lector is telling us that to avoid counting an
array item amout thanks count($my_array), he tells we can do:
while($my_array)
{
... do something
}
but from experience this is an infinity loop...
it should be always something like
$count =
On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote:
Alain Roger wrote:
Hi,
i'm on PHP training and our lector is telling us that to avoid counting an
array item amout thanks count($my_array), he tells we can do:
while($my_array)
{
... do something
}
but from experience this
Boyd, Todd M. wrote:
Are you sure this isn't like Javascript's getMonth function? Its index may begin at 0, making
day 0 the first day of the year.
HTH,
Todd Boyd
Web Programmer
Hmm, though I know us programmers love to start counting at zero, why
would something as static as a date
My eyes are bleeding!
Did you ever see it working before?
Ash
www.ashleysheridan.co.uk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hej Stefan,
This was/is a question if something is worth a change request. This
concerns the development of PHP and in my eyes belongs on internals. Am
I mistaken here?
Yes, because you are like the 100th person to request that. A mail to
general@ probably would have told you that.
I am
Richard Heyes wrote:
yup..
bWarning/b: func_get_args(): Called from the global scope - no
function context
Doesn't the name of the function give you a clue as to its use? You
need to call it inside a function.
He was answering Nathan's question regarding what would happen IF you
-Original Message-
From: Craige Leeder [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2008 4:50 PM
To: Boyd, Todd M.
Cc: [EMAIL PROTECTED]; php-general@lists.php.net
Subject: Re: [PHP] Date Issue
Boyd, Todd M. wrote:
Are you sure this isn't like Javascript's getMonth
On Mon, 2008-11-17 at 16:57 -0600, Boyd, Todd M. wrote:
-Original Message-
From: Craige Leeder [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2008 4:50 PM
To: Boyd, Todd M.
Cc: [EMAIL PROTECTED]; php-general@lists.php.net
Subject: Re: [PHP] Date Issue
Boyd, Todd M.
Ashley Sheridan wrote:
On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote:
Only thing to note with the foreach is that you are actually working on
a copy of the array, so if you intend to modify it, pass it by reference.
- Craige
Can you do that? I assume it would look like this:
On Mon, 2008-11-17 at 18:01 -0500, Craige Leeder wrote:
Ashley Sheridan wrote:
On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote:
Only thing to note with the foreach is that you are actually working on
a copy of the array, so if you intend to modify it, pass it by reference.
Hej Jochem,
this kind of thing belongs on php-general (and lets keep it on list
please), if you have a serious proposal/rfc and/or one develops from a
discussion
there then likely some of the old-hats will likely recommend escalating to
internal.
I'm sorry I wasn't aware of this procedure.
Sorry for the delay.
The purpose is to be able to see what is running on a site at any given time.
If we are webhosting we want to make sure something is live or not and see the
whole page, without visiting each and every site. Plus the sites might change
so we want to know at any given time.
bruce wrote:
curious qiestion
to all on here who dabble in php... how many of you have actully gone to
college, taken algorithm courses, microprocessor courses,
design/architecture courses, etc..
or is the majority of the work here from people who've grabbed the tools and
started
Christopher Vogt schreef:
Hej Jochem,
this kind of thing belongs on php-general (and lets keep it on list
please), if you have a serious proposal/rfc and/or one develops from a
discussion
there then likely some of the old-hats will likely recommend escalating to
internal.
I'm sorry I
Craige Leeder schreef:
bruce wrote:
curious qiestion
to all on here who dabble in php... how many of you have actully gone to
college, taken algorithm courses, microprocessor courses,
design/architecture courses, etc..
or is the majority of the work here from people who've grabbed the
tedd schreef:
At 10:00 AM -0800 11/17/08, bruce wrote:
curious qiestion
to all on here who dabble in php... how many of you have actully gone to
college, taken algorithm courses, microprocessor courses,
design/architecture courses, etc..
or is the majority of the work here from people
Thanks Nathan, but as I mentioned, I AM using the Zend Eclipse debugging
plugin.
Using the Zend internal php debugger does not save me the trouble of
running a web-server. The point is, i NEED to perform the code step-through
on my IIS server, because that is my real-world production
Jochem Maas wrote:
must . resist
I take you didn't score to hig on the spelling test? and collage,
is that the the cut-n-paste school of IT?
dang it, failed. ;-)
Haha! 'high' was just my 'h' key not pressing, and college is just one
of those words I have trouble with.
On Mon, 2008-11-17 at 18:48 -0500, Joey wrote:
Sorry for the delay.
The purpose is to be able to see what is running on a site at any given time.
If we are webhosting we want to make sure something is live or not and see
the whole page, without visiting each and every site. Plus the sites
Craige Leeder schreef:
Ashley Sheridan wrote:
On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote:
Only thing to note with the foreach is that you are actually working
on a copy of the array, so if you intend to modify it, pass it by
reference.
- Craige
Can you do that? I
On Mon, 17 Nov 2008 14:30:34 -0500, tedd.sperling wrote:
I can program with rocks -- and do a good job of it. I can make a one
that can stand for a couple of thousand years.
http://xkcd.com/505/
--
Ross McKay, Toronto, NSW Australia
Before enlightenment: chop wood, carry water;
After
At 10:49 PM + 11/17/08, Ashley Sheridan wrote:
So just trolling here, but do conditional comments in HTML make it a
programming language? :p
Why not?
Sure, it's a mark-up language but if you don't program it right, it
will screw up -- it's just more forgiving than most. Also, CSS is a
At 11:40 AM +1100 11/18/08, Ross McKay wrote:
On Mon, 17 Nov 2008 14:30:34 -0500, tedd.sperling wrote:
I can program with rocks -- and do a good job of it. I can make a one
that can stand for a couple of thousand years.
http://xkcd.com/505/
Ross:
That's super and fits.
The only
At 12:52 AM +0100 11/18/08, Jochem Maas wrote:
Craige Leeder schreef:
I'm 100% self taught for now. I'm just out of higschool, and hopefully
going off to collage next year.
must . resist
I take you didn't score to hig on the spelling test? and collage,
is that the the
At 7:02 PM -0500 11/17/08, Craige Leeder wrote:
I'm not illiterate; promise :p
- Craige
Yeah, his parents were married before he was born.
Cheers,
tedd
--
---
http://sperling.com http://ancientstones.com http://earthstones.com
--
PHP General Mailing List (http://www.php.net/)
To
Jay Blanchard wrote:
[snip]
...foreach...
[/snip]
You could also use a for loop if you wanted to count;
for($i = 0; $i count($array); $i++){
echo $i . \n;
}
This is not good because you are calling count every loop iteration.
Thank you,
Micah Gersten
onShore Networks
Internal
On Mon, 17 Nov 2008 11:43:31 -0800, Yeti wrote:
Ok, ok I admit it. PHP is a programming language. I guess I drank too
much assembly code today.
By the way ... Motorola 68000! Those were to good old days.
680x0 was the nicest machine I ever met - especially nice when writing
for OS-9/68000. Yup,
tedd schreef:
At 12:52 AM +0100 11/18/08, Jochem Maas wrote:
Craige Leeder schreef:
I'm 100% self taught for now. I'm just out of higschool, and hopefully
going off to collage next year.
must . resist
I take you didn't score to hig on the spelling test? and collage,
is that
Craige Leeder schreef:
Jochem Maas wrote:
must . resist
I take you didn't score to hig on the spelling test? and collage,
is that the the cut-n-paste school of IT?
dang it, failed. ;-)
Haha! 'high' was just my 'h' key not pressing, and college is just one
of those
Terion Miller wrote:
Help I inherited this script and just found that its not inserting anything
into the workorderform table in the db, and I'm getting implode() errors
for the 'bannersize' isset line
New and need help in over my head:
here is the code:
First off, I would argue that this
86 matches
Mail list logo