[PHP] Re: How to print variable name and contents

2005-06-17 Thread Bob Winter
nntp.charter.net wrote: I want to write a trace procedure and call it with variable names, and I am having trouble with the syntax. My goal is to have a procedure that will echo lines such as: Trace: $myvar="the contents of $myvar My attempt that didn't work is to write a function: functi

[PHP] Re: How to print variable name and contents

2005-06-17 Thread Bob Winter
Bob Winter wrote: nntp.charter.net wrote: I want to write a trace procedure and call it with variable names, and I am having trouble with the syntax. My goal is to have a procedure that will echo lines such as: Trace: $myvar="the contents of $myvar My attempt that didn't

[PHP] Re: rename

2005-06-18 Thread Bob Winter
Look at http://us2.php.net/manual/en/function.rename.php Mister Jack wrote: Hi, I would like to know precisely what rename do in case of error. any link for that ? I do a : @rename($old, $new), what happens if I run out of space ? is the rename just an alias for C function library ? thanks --

[PHP] Re: Allowed memory size of

2005-06-20 Thread Bob Winter
David, Perhaps your memory usage and/or memory limit is different than what you are assuming it is. If you add the following code to your script, in several places if necessary, it should help you debug it . // PRINT CURRENT MEMORY USAGE: http://us4.php.net/manual/en/function.memory-get-us

Re: [PHP] Re: Allowed memory size of

2005-06-21 Thread Bob Winter
d set a default value more efficient in the php.ini That show the same error. Thanks for your helps david Le Mon, 20 Jun 2005 16:46:36 +0200, Bob Winter <[EMAIL PROTECTED]> a écrit: David, Perhaps your memory usage and/or memory limit is different than what you are assuming

Re: [PHP] Re: Allowed memory size of

2005-06-21 Thread Bob Winter
orums wrote: I did it IT works with 256M memory allocated. After realising the line it shown 69505726(little more )Mo as memory usage. It's in some way really not understandable. I suppose it could be a php bug. tx david Le Tue, 21 Jun 2005 16:35:20 +0200, Bob Winter <[EMAIL PROTECTE

[PHP] Re: array_search() with preg_match?

2005-06-23 Thread Bob Winter
René, This may not the most efficient method, but works: $array = array('this sky is blue', 'pencils are orange', 'I like green apples','strawberries are red'); $search = 'green'; $result = array(); foreach($array as $key1=>$value1) { if(substr_count($value1, $search)) { $result[] = $key

Re: [PHP] Problem with arrays

2005-06-24 Thread Bob Winter
Mike Johnson wrote: From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Hi, I have 2 arrays: Array ( [0] => Array ( [0] => 28 [1] => Music ) [1] => Array (

[PHP] Re: newline and pregreplace

2005-06-24 Thread Bob Winter
Dotan Cohen wrote: I've got a line like this: $str=preg_replace( "-regex here-", '\n\1', $str); Which has one of two problems: If I leave the single quotes around the second argument, then it returns as \n and not a newline. If I change the single quotes to double quotes, then the info from the

[PHP] Re: newline and pregreplace

2005-06-24 Thread Bob Winter
Bob Winter wrote: Dotan Cohen wrote: I've got a line like this: $str=preg_replace( "-regex here-", '\n\1', $str); Which has one of two problems: If I leave the single quotes around the second argument, then it returns as \n and not a newline. If I change the singl

Re: [PHP] Correcting contractions

2005-06-24 Thread Bob Winter
Dotan Cohen wrote: On 6/25/05, Robert Cummings <[EMAIL PROTECTED]> wrote: On Fri, 2005-06-24 at 21:02, Dotan Cohen wrote: Hi friends, I've got a nice array of contractions (I've, I'd, they'll,...). My intent is to take submitted data and replace, say, every occurance of 'theyd' with 'they'd

Re: [PHP] shell expansion (globbing) from inside php cli script

2005-06-27 Thread Bob Winter
Brian, Can you post more of the script? --Bob Brian V Bonini wrote: On Mon, 27 Jun 2005, [ISO-8859-1] Andr? Medeiros wrote: $cmd = 'scp ' . $user . '@stagingcws.' . $tld . ':' . $directory/{' . $files . '} ' . $tmp_dir . '/'; That should work On 6/27/05, [EMAIL PROTECTED] <[EMAIL PROTECTE

[PHP] Re: Files

2005-06-28 Thread Bob Winter
Chris, He's my take on your problem, I have used a few different functions but followed the same pattern as your original script. Check out http://www.php.net/manual/en/ to get the details on the ones you don't understand. I have not included error checking. This example works successfully

Re: [PHP] shell expansion (globbing) from inside php cli script

2005-06-28 Thread Bob Winter
Brian, The format of your string that works for me is : $cmd = "scp [EMAIL PROTECTED]:$directory/\{$files\} $tmp_dir"; $files must be a comma separated string with NO SPACES. Here is my complete test script for your review: START = #!/usr/bin/php === END Hope this solves

Re: [PHP] shell expansion (globbing) from inside php cli script

2005-06-29 Thread Bob Winter
Brian V Bonini wrote: I tried that too. I get '/{a,s,d,f\}' in the string if I use it that way. Are you saying that you were able to do a succesful transfer using the above? I can output a string that SHOULD work, e.g. "scp [EMAIL PROTECTED]:/dir/{file1,file2,file3} /dir/." but when run from with

Re: [PHP] shell expansion (globbing) from inside php cli script

2005-06-30 Thread Bob Winter
Brian, Is "/www/files/services/" the correct relative path?? You could try using the absolute path to see if it fixes the problem. Also, and maybe more significant, I use tcsh . . . if you use bash this could be the conflict. I see that the echo of the $cmd string from PHP is missing th