Re: [PHP] howto get pgUp, pgDn, delete, home and end keycodes in CLI PHP script

2012-05-04 Thread Andres Gonzalez
Thank you for your reply Stuart, I will look at ncurses extensions. -Andres Stuart Dallas wrote: On 4 May 2012, at 15:48, Andres Gonzalez wrote: I am trying to code a CLI PHP script that will give me the keycodes for these (and other) keyboard keys. I want to basically block until the

Re: [PHP] howto get pgUp, pgDn, delete, home and end keycodes in CLI PHP script

2012-05-04 Thread Andres Gonzalez
etc, only codes for regular keys. -Andres David OBrien wrote: ? On Fri, May 4, 2012 at 10:48 AM, Andres Gonzalez mailto:and...@packetstorm.com>> wrote: I am trying to code a CLI PHP script that will give me the keycodes for these (and other) keyboard keys. I want to basically

[PHP] howto get pgUp, pgDn, delete, home and end keycodes in CLI PHP script

2012-05-04 Thread Andres Gonzalez
I am trying to code a CLI PHP script that will give me the keycodes for these (and other) keyboard keys. I want to basically block until the user presses a single key, then I want to process that event without the user having to press the Enter key after pressing a single key. I have tried sev

Re: [PHP] editing a file

2010-05-24 Thread Andres Gonzalez
thank you Rene, that is the start I needed. -Andres Rene Veerman wrote: On Mon, May 24, 2010 at 11:16 PM, Andres Gonzalez wrote: I have a large C source file that is generated by a separate source-generating program. When the generated src file is compiled, it produces tons of warnings

[PHP] editing a file

2010-05-24 Thread Andres Gonzalez
I have a large C source file that is generated by a separate source-generating program. When the generated src file is compiled, it produces tons of warnings. I want to edit the generated src file and delete the offending lines. What is the easiest way using a PHP script to read in a file, sea

[PHP] PHP and javascript

2010-01-15 Thread Andres Gonzalez
How do I call PHP code that will run server side, from javascript code that is running client side? I have a lot of PHP server side code written and working within CodeIgniter. Now, my project has changed and (for reasons unimportant to this discussion) we are now NOT going to use apache and

[PHP] moving to quad core

2009-09-15 Thread Andres Gonzalez
I have an application developed that uses alot of PHP. Currently, it is running on a Ubuntu 8.04 , single core CPU host. We are moving to a quad core host for this application. Is there anything special that I need to do to configure PHP to run on a quad core host? I noticed that my current s

Re: [PHP] php.ini in cgi vs php.ini in cli

2009-09-15 Thread Andres Gonzalez
again for your help--you deserve a raise. :-) -Andres Lars Torben Wilson wrote: On Mon, 14 Sep 2009 18:21:11 -0400 Andres Gonzalez wrote: In the php configurations directories /etc/php5, there are 2 subdirectories, one for cgi and one for cli. There is a php.ini file in each of these

[PHP] php.ini in cgi vs php.ini in cli

2009-09-14 Thread Andres Gonzalez
In the php configurations directories /etc/php5, there are 2 subdirectories, one for cgi and one for cli. There is a php.ini file in each of these directories. What would cause a difference of behavior in these 2 environments with the php.ini exactly the same in each directory?? I have a com

Re: [PHP] Re: file_put_contents problem

2009-09-14 Thread Andres Gonzalez
well. did u try to open the file? on windows often a file is reported as 0 bytes as of failing the refresh in explorer. ralph_def...@yahoo.de "Andres Gonzalez" wrote in message news:4aae510e.8030...@packetstorm.com... I have read in the contents of a file using file_get_conte

Re: [PHP] file_put_contents problem

2009-09-14 Thread Andres Gonzalez
thank you for your responses. This appears to be a CodeIgniter problem because everything of course works fine from a command line script. I will post a question on their forum. Thanks again. -Andres Jim Lucas wrote: Andres Gonzalez wrote: I have read in the contents of a file using

[PHP] file_put_contents problem

2009-09-14 Thread Andres Gonzalez
I have read in the contents of a file using file_get_contents. I can verify that the data has actually been read in by echoing its contents. But then if I do this: $ret = file_put_contents("/tmp/bla", $bk); The return value gives the correct size of string $bk, and the file /tmp/bla is created

Re: [PHP] removing an array from a compound array

2009-07-02 Thread Andres Gonzalez
Duh! I should have known that. I actually tried that and had a problem so I thought unset() would not work on an array. Guess that problem was elsewhere. Thanks for the responses... -Andres Ford, Mike wrote: -Original Message- From: Andres Gonzalez [mailto:and...@packetstorm.com

[PHP] removing an array from a compound array

2009-07-01 Thread Andres Gonzalez
I have a compound array, that is, an array of an array of an array, etc, that is about 5 arrays deep. I currently search thru all of these arrays, and based on some criteria, I want to delete one of the arrays (along with all of its sub-arrays) in the middle. What is the easiest way to delete s

Re: [PHP] modifying within foreach

2009-06-23 Thread Andres Gonzalez
: Andres Gonzalez wrote on 06/23/2009 12:26:38 PM: I want to modify $results within the foreach. In other words, during a given pass of this iteration, I want to delete some of the items based on particular conditions. Then on the next pass thru the foreach, I want $results to be the newer

Re: [PHP] modifying within foreach

2009-06-23 Thread Andres Gonzalez
{ if ($item == 'foo') unset($results[$key]); } -Original Message- From: Andres Gonzalez [mailto:and...@packetstorm.com] Sent: Tuesday, June 23, 2009 11:27 AM To: php-general@lists.php.net Subject: [PHP] modifying within foreach In the following example: foreach ($results as $key =&

[PHP] modifying within foreach

2009-06-23 Thread Andres Gonzalez
In the following example: foreach ($results as $key => $item) { //bla bla bla -- unset some of the $items } I want to modify $results within the foreach. In other words, during a given pass of this iteration, I want to delete some of the items based on particular conditions. Then on the ne

Re: [PHP] multi-dimensional arrays

2009-04-13 Thread Andres Gonzalez
I was having the same problem. The second way was what I was looking for. Thank you so much for your help--I did not know about preg_match_all(). very coolthanks again. -Andres Shawn McKenzie wrote: Shawn McKenzie wrote: Well in your approach you get a bunch of empty elements where t

[PHP] multi-dimensional arrays

2009-04-13 Thread Andres Gonzalez
Hi, I am learning PHP and have a simple question. I have a input string in this form: xxx xx x xx xxx xx x x xxx xx xx . . . xx xxx xx xx xx each line has 6 words of various lengths, all separated by white space. the input string can have any

[PHP] problems with loaded extensions

2009-04-08 Thread Andres Gonzalez
Hi, I have got an extension loaded in all three of my php config files (in cli, in cgi, and in apache2 directories). The functions in the extension are all accessible when running test scripts from the command line, like: php init.php for example, in the init.php file I have calls to sever

Re: [PHP] newbe question

2009-03-25 Thread Andres Gonzalez
some script output!" is a valid script. --- Kyle Smith Unix Systems Administrator Inforonics, LLC -Original Message- From: Andres Gonzalez [mailto:and...@packetstorm.com] Sent: Wednesday, March 25, 2009 11:29 AM To: php-general@lists.php.net Subject: [PHP] newbe question Hi, I

Re: [PHP] newbe question

2009-03-25 Thread Andres Gonzalez
I just figured this out. It all depends on what is AFTER the last ?> tag. If I do not have extra line feeds they are not printed. Wow... thanks, -Andres Andres Gonzalez wrote: Hi, I want to learn PHP so I started using it for all of my general purpose scripts. The general format of

[PHP] newbe question

2009-03-25 Thread Andres Gonzalez
Hi, I want to learn PHP so I started using it for all of my general purpose scripts. The general format of my scripts are like this: #!/usr/bin/php When I run my scripts and I have an echo (or print) at the end of the script to print out the results of the script, I get an extra line feed