php-general Digest 26 Oct 2012 01:16:02 -0000 Issue 8022

Topics (messages 319588 through 319598):

Re: Help using PHP 5.3.3 mail() with Apache James
        319588 by: tamouse mailing lists

PCRE Expression
        319589 by: Volmar Machado
        319590 by: Camille Hodoul

Date manipulation
        319591 by: Ron Piggott
        319592 by: Daniel Brown
        319593 by: Marc Guay

select function
        319594 by: Jeff Burcher
        319595 by: Daniel Brown
        319596 by: Stuart Dallas
        319597 by: Ford, Mike

URGENT! Need help with command line for "list all new/modified files within the 
last 24 hours"
        319598 by: lamp.afan.net

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On Thu, Oct 25, 2012 at 5:32 AM, Maciek Sokolewicz
<maciek.sokolew...@gmail.com> wrote:
> On 23-10-2012 23:54, Steven Pogue wrote:
>>
>> Dan,
>> I assume you meant to add a system() call into it...if so, here is what
>> was presented.
>>
>> -rwxrwxrwx. 1 root root 3878 Sep  6 14:45 /opt/james-2.3.2/bin/sendmail.py
>> -rwxrwxrwx. 1 root root 3878 Sep  6 14:45 /opt/james-2.3.2/bin/sendmail.py
>>
>>
>> Steve
>>
> Hey Steve,
>
> first of all: don't top-post.
> Secondly: no, he didn't. Dan used the backtick operator (`) which is the
> same as calling system on its parameter.
>
> ie:
> `ls -l`
> is equal to writing
> shell_exec('ls -l')
>
> ( http://www.php.net/manual/en/language.operators.execution.php )

I have "lost" the backtick operator so many times, I've stopped using
it, using shell_exec instead.

--- End Message ---
--- Begin Message ---
Hi All,

 I have this expression :  '/\{(\n*[a-z\-]*:[a-z\s0-9]*;\n*)\}/s'
which grep all single property css like:

.chalala{
float:left;
}

.chalala{float:left;}

.chalala{
float:left;}

But I want to grep multiples properties like:


.chalala{
float:left;
float:right;
}

So I think that I need to repeat subgroup many times and put a '*'
after subgroup, like this:  '/\{(\n*[a-z\-]*:[a-z\s0-9]*;\n*)*\}/s'
but didn't work, how I can check if a subgroup repeat {0,} ?

--- End Message ---
--- Begin Message ---
which pcre function do you use ?
\{(\n*[a-z\-]*:[a-z\s0-9]*;\n*)*\} seems to work on my regex tester.

Le 25/10/2012 18:51, Volmar Machado a écrit :
Hi All,

  I have this expression :  '/\{(\n*[a-z\-]*:[a-z\s0-9]*;\n*)\}/s'
which grep all single property css like:

.chalala{
float:left;
}

.chalala{float:left;}

.chalala{
float:left;}

But I want to grep multiples properties like:


.chalala{
float:left;
float:right;
}

So I think that I need to repeat subgroup many times and put a '*'
after subgroup, like this:  '/\{(\n*[a-z\-]*:[a-z\s0-9]*;\n*)*\}/s'
but didn't work, how I can check if a subgroup repeat {0,} ?


--
Camille Hodoul
http://camille-hodoul.com


--- End Message ---
--- Begin Message ---
Is it possible for PHP to accept the following as a date:

04:11:22 Aug 21, 2011 PDT

so I may output it as:

gmdate(‘Y-m-d H:i:s’)

- I want the time zone included

Ron


Ron Piggott



www.TheVerseOfTheDay.info 

--- End Message ---
--- Begin Message ---
On Thu, Oct 25, 2012 at 3:06 PM, Ron Piggott
<ron.pigg...@actsministries.org> wrote:
>
> Is it possible for PHP to accept the following as a date:
>
> 04:11:22 Aug 21, 2011 PDT
>
> so I may output it as:
>
> gmdate(‘Y-m-d H:i:s’)
>
> - I want the time zone included

    Sure.

<?php

$ds = strtotime('04:11:22 Aug 21, 2011 PDT');

echo gmdate('Y-m-d H:i:s',$ds);

?>

-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

--- End Message ---
--- Begin Message ---
$time = strtotime('04:11:22 Aug 21, 2011 PDT');
echo date('Y-m-d H:i:s T', $time);

Marc

--- End Message ---
--- Begin Message ---
Hi,

 

I can't remember if this is the PHP list for RPG programmers or not, so
apologize if this is the wrong one.

 

Is there an equivalent command in PHP for the SELECT statement in RPG? I see
switch, which is a little similar, but far from how it actually functions.

 

For those not familiar with the SELECT statement here is how I envision it
working in a PHP format similar to switch:

 

SELECT {

                WHEN $Auth = 0:

                WHEN $A = 1:

                                echo('$Aprint_list');

                WHEN $B = 1:

                                echo('$Bprint_list');

                WHEN $A = 2:

                                echo('$Aprint_list');

                                echo('$Aprint_list');

                WHEN $B = 2:

                                echo('$Bprint_list');

                                echo('$Bprint_list');

                DEFAULT:

}

 

The syntax may be a little off, but you get the picture. No breaks are
needed because it only performs the first match it comes to, then exits the
SELECT statement when finished the commands under that match. Putting a WHEN
statement with nothing to perform means exactly that, if this matches, do
nothing, then exit the SELECT statement. I hope that makes sense. The big
difference is you can put anything behind each WHEN statement as opposed to
looking at only the one variable like with switch. I am thinking I just need
to get creative with the switch or elseif commands, but thought I would ask
the list first if they had any better suggestions.

 

 

Thanks,

 

Jeff Burcher - IT Dept

Allred Metal Stamping

PO Box 2566

High Point, NC 27261

(336)886-5221 x229

j...@allredmetal.com

 


--- End Message ---
--- Begin Message ---
On Thu, Oct 25, 2012 at 5:35 PM, Jeff Burcher <j...@allredmetal.com> wrote:
> Hi,
>
>
>
> I can't remember if this is the PHP list for RPG programmers or not, so
> apologize if this is the wrong one.

    This is just a general PHP mailing list.  Guessing you need the other one.

-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

--- End Message ---
--- Begin Message ---
On 25 Oct 2012, at 22:35, "Jeff Burcher" <j...@allredmetal.com> wrote:
> I can't remember if this is the PHP list for RPG programmers or not, so
> apologize if this is the wrong one.

Not an RPG list, but your question is PHP-related more than it's RPG-related.

> Is there an equivalent command in PHP for the SELECT statement in RPG? I see
> switch, which is a little similar, but far from how it actually functions.
> 
> For those not familiar with the SELECT statement here is how I envision it
> working in a PHP format similar to switch:
> 
> SELECT {
>                 WHEN $Auth = 0:
>               WHEN $A = 1:
>                                 echo('$Aprint_list');
>               WHEN $B = 1:
>                                 echo('$Bprint_list');
>               WHEN $A = 2:
>                                 echo('$Aprint_list');
>                               echo('$Aprint_list');
>                 WHEN $B = 2:
>                               echo('$Bprint_list');
>                                 echo('$Bprint_list');
>               DEFAULT:
> }
> 
> The syntax may be a little off, but you get the picture. No breaks are
> needed because it only performs the first match it comes to, then exits the
> SELECT statement when finished the commands under that match. Putting a WHEN
> statement with nothing to perform means exactly that, if this matches, do
> nothing, then exit the SELECT statement. I hope that makes sense. The big
> difference is you can put anything behind each WHEN statement as opposed to
> looking at only the one variable like with switch. I am thinking I just need
> to get creative with the switch or elseif commands, but thought I would ask
> the list first if they had any better suggestions.

You don't need to "get creative" with anything as that's exactly how switch 
works if you have a break at the end of each case. So your example would look 
like so:

switch (true) {
  case $Auth == 0:
    break;
  case $A == 1:
    echo('$Aprint_list');
    break;
  case $B == 1:
    echo('$Bprint_list');
    break;
  case $A == 2:
    echo('$Aprint_list');
    echo('$Aprint_list');
    break;
  case $B == 2:
    echo('$Bprint_list');
    echo('$Bprint_list');
    break;
  default:
    break;
}

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Stuart Dallas [mailto:stu...@3ft9.com]
> Sent: 25 October 2012 22:48

Aw, nuts! Stuart, you just beat me to it! I was half way through writing an 
almost identical post when yours popped into my Inbox....

Cheers!

Mike

-- 
Mike Ford,
Electronic Information Developer, Libraries and Learning Innovation,  
Portland PD507, City Campus, Leeds Metropolitan University,
Portland Way, LEEDS,  LS1 3HE,  United Kingdom 
E: m.f...@leedsmet.ac.uk     T: +44 113 812 4730





To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

--- End Message ---
--- Begin Message ---
Hi to all,
My site with Drupal 7. I contacted tech support and he said he accessed to
the site with FTP - what I doubt. But if it's truth - it's even worse
because whole server is then compromised.
I need help with command line for "list all new/modified files within the
last 24 hours".

Thanks for any help,
LAMP


--- End Message ---

Reply via email to