Lars Torben Wilson wrote:
2009/8/20 Jim Lucas :
Lars Torben Wilson wrote:
2009/8/19 Per Jessen :
Jim Lucas wrote:
[snip]
I probably wouldn't have chosen PHP for the first one, but there's no
reason it shouldn't work. For the second one, did you mean to
write "serial port"? That's a bit of
Aargh. Slipped on the trigger there--premature Send. See below for
what I meant to send:
2009/8/22 Lars Torben Wilson :
> 2009/8/22 Keith :
>> Thanks! Torben.
>> I got the point now and it works! :-)
>> I'm doing this because the statements of each cases is quite long, and I
>> wish to have minimu
2009/8/22 Keith :
> Thanks! Torben.
> I got the point now and it works! :-)
> I'm doing this because the statements of each cases is quite long, and I
> wish to have minimum coding without repetition.
Hi Keith,
Glad it works! I'm not sure how inverting the case statement helps you
minimize the co
Hahaha! Actually this is my first time coding, so I still adapting the
correct way to do it.
FYI, for the sake of minimizing the coding and viewing space occupied of the
code, I even replace the switch block with array if the cases are just
merely selecting pool of variables/categories/parameter
Thanks! Adam.
It works now!
Actually I thought that switch block is compatible with if/elseif/else block
but more efficient if the cases is >3.
Because I like to have short coding without repetition, so I group the
similar cases together.
Thanks for your explanation! I know where is my mistake a
Thanks! Torben.
I got the point now and it works! :-)
I'm doing this because the statements of each cases is quite long, and I
wish to have minimum coding without repetition.
"Lars Torben Wilson" wrote in message
news:36d4833b0908202323p3c858b5fn6a1d6775aa7f8...@mail.gmail.com...
2009/8/20
Hello,
You might also want to try using the Raxan framework:
require_once 'raxan/pdi/gateway.php';
$page = new RichWebPage('page.html');
echo $page['a']->text(); // this will get the text betwen the a tag
To get the image element use:
$elm = $page['a img']->node(0);
You can download Raxan he
On Sat, 22 Aug 2009 14:02:58 +0100, a...@ashleysheridan.co.uk (Ashley Sheridan)
wrote:
>On Sat, 2009-08-22 at 13:00 +0100, Richard Heyes wrote:
>> Hi,
>>
>> > Is there a way to round down to the nearest 50?
>> >
>> > Example: Any number between 400 and 449 I would 400 to be displayed; 450
>> >
On Sat, 22 Aug 2009 20:37:17 +0930, robl...@aapt.net.au (David Robley) wrote:
>Clancy wrote:
>
>> $ok = include (HOST_PATH.'/Halla.php');
>
>Because you are assigning the result of the include to a variable. Try
>
>include (HOST_PATH.'/Halla.php');
>
>and it will work as you expect. And similarly
2009/8/22 Szczepan Hołyszewski :
>> Hm. . .it does look odd. Searching the bugs database at
>> http://bugs.php.net does turn up one other report (at
>> http://bugs.php.net/bug.php?id=47870 ) of array() returning NULL in
>> certain hard-to-duplicate circumstances on FreeBSD,
>
> Yes, I found it even
> Hm. . .it does look odd. Searching the bugs database at
> http://bugs.php.net does turn up one other report (at
> http://bugs.php.net/bug.php?id=47870 ) of array() returning NULL in
> certain hard-to-duplicate circumstances on FreeBSD,
Yes, I found it even before posting here, but I wasn't sure
well, when I saw ur post I got immediately the thought I would bed it has to
do with some stuff of $this or self.
I did play arround a bit with class creation the last days and yes, with
using self parent and $this I did put the HTTPPD in unstable and sometimes
it died without beeing able to send
Didn't seem to make it the first time.
Shawn McKenzie wrote:
> דניאל דנון wrote:
>> Lets assume I have the string "cats i saw a cat and a dog"
>> i want to strip everything except "cat" and "dog" so the result will be
>> "catcatdog",
>> using preg_replace.
>>
>>
>> I've tried something like /[^(d
2009/8/22 Szczepan Hołyszewski :
>> What it looks like to me is that something is causing $foo to be a
>> string before the '$foo[] = "bar";' line is encountered. What do you
>> get if you put a gettype($foo); just before that line?
>>
>> > $foo=null;
>> > $foo[]="bar"; // <-- $f
> What it looks like to me is that something is causing $foo to be a
> string before the '$foo[] = "bar";' line is encountered. What do you
> get if you put a gettype($foo); just before that line?
>
> >$foo=null;
> >$foo[]="bar"; // <-- $foo simply becomes an array
NULL. That
דניאל דנון wrote:
> Lets assume I have the string "cats i saw a cat and a dog"
> i want to strip everything except "cat" and "dog" so the result will be
> "catcatdog",
> using preg_replace.
>
>
> I've tried something like /[^(dog|cat)]+/ but no success
>
> What should I do?
>
Capture everythi
2009/8/22 Szczepan Hołyszewski :
> Hello!
>
> I am almost certain I am hitting some kind of bug. All of a sudden, array()
> stops returning an empty array and starts returning something weird. The weird
> thing behaves as NULL in most circumstances (e.g. gettype() says NULL),
> except:
>
> $
Hello!
I am almost certain I am hitting some kind of bug. All of a sudden, array()
stops returning an empty array and starts returning something weird. The weird
thing behaves as NULL in most circumstances (e.g. gettype() says NULL),
except:
$foo=array(); // <-- weird thing return
Hi,
> ...
A little modification:
= 50 ? '50' : '00'));
}
echo myRound(449) . ''; // 400
echo myRound(450) . ''; // 450
echo myRound(356) . ''; // 350
echo myRound(79) . ''; // 50
?>
PS I haven't checked if there's a PHP function for this.
--
Richard Heyes
HTML5 graphing:
Negating specific words with regexes isn't a good practice (see a deep
discussion here: http://www.perlmonks.org/?node_id=588315), in your
case I would resolve it like this:
That will output:
array(5) {
[0]=>
string(3) "cat"
[1]=>
string(10) "s i saw a "
[2]=>
string(3) "cat"
[3]=
Sumit Sharma wrote:
> Hi all,
> The site I have download was developed using cake php. Now when trying to
> access the website it is showing a blank page. As Sudheer suggested I went
> to error log and noted down the errors there, which are as follows:
>
> [Thu Aug 20 14:10:16 2009] [error] [clien
Lets assume I have the string "cats i saw a cat and a dog"
i want to strip everything except "cat" and "dog" so the result will be
"catcatdog",
using preg_replace.
I've tried something like /[^(dog|cat)]+/ but no success
What should I do?
--
Use ROT26 for best security
Hi,
> It should be round() and not floor().
>
> 449 / 50 = 8.98
> floor(8.98) = 8
> 8 * 50 = 400
>
> round(8.98) = 9
> 9 * 50 = 450
Not based on the examples given:
> Example: Any number between 400 and 449 I would 400 to be displayed
--
Richard Heyes
HTML5 graphing: RGraph - www.rgraph.net (u
I also wrote a function for that,
function round_to($number, $increments) {
$increments = 1 / $increments;
return (round($number * $increments) / $increments);
}
(Also published on php manual - round() )
On Sat, Aug 22, 2009 at 4:11 PM, Ron Piggott wrote:
> Thanks; Amazing. Ron
>
> - Orig
Thanks; Amazing. Ron
- Original Message -
From: "Ashley Sheridan"
To: "Richard Heyes"
Cc: "Ron Piggott" ;
Sent: Saturday, August 22, 2009 9:02 AM
Subject: Re: [PHP] Rounding down?
On Sat, 2009-08-22 at 13:00 +0100, Richard Heyes wrote:
Hi,
> Is there a way to round down to the
On Sat, 2009-08-22 at 13:00 +0100, Richard Heyes wrote:
> Hi,
>
> > Is there a way to round down to the nearest 50?
> >
> > Example: Any number between 400 and 449 I would 400 to be displayed; 450 to
> > 499 would be 450; 500 to 549 would be 500, etc?
>
> Off the top of my head: divide the numbe
Hi,
> Is there a way to round down to the nearest 50?
>
> Example: Any number between 400 and 449 I would 400 to be displayed; 450 to
> 499 would be 450; 500 to 549 would be 500, etc?
Off the top of my head: divide the number by 50, run floor() on the
result, then times it by 50.
1. 449 / 50 =
Clancy wrote:
> $ok = include (HOST_PATH.'/Halla.php');
Because you are assigning the result of the include to a variable. Try
include (HOST_PATH.'/Halla.php');
and it will work as you expect. And similarly for
define ('HOST_PATH','../Engine');
Cheers
--
David Robley
Dynamic linking erro
Ron Piggott wrote:
> Is there a way to round down to the nearest 50?
>
> Example: Any number between 400 and 449 I would 400 to be displayed; 450
> to 499 would be 450; 500 to 549 would be 500, etc?
>
> The original number of subscribers is from a mySQL query and changes each
> day. I am trying
Is there a way to round down to the nearest 50?
Example: Any number between 400 and 449 I would 400 to be displayed; 450 to 499
would be 450; 500 to 549 would be 500, etc?
The original number of subscribers is from a mySQL query and changes each day.
I am trying to present a factual statement:
2009/8/20 Jim Lucas :
> Lars Torben Wilson wrote:
>> 2009/8/19 Per Jessen :
>>> Jim Lucas wrote:
>>
>> [snip]
>>
>>> I probably wouldn't have chosen PHP for the first one, but there's no
>>> reason it shouldn't work. For the second one, did you mean to
>>> write "serial port"? That's a bit of a d
On Fri, 21 Aug 2009 15:16:11 +0200, ak...@telkomsa.net ("Arno Kuhl") wrote:
>-Original Message-
>From: Clancy [mailto:clanc...@cybec.com.au]
>Sent: 21 August 2009 01:26 PM
>To: php-general@lists.php.net
>Subject: [PHP] Invoking functions stored in a separate directory?
>
>I am developing
32 matches
Mail list logo