[PHP] Rewind foreach loop

2007-11-29 Thread Jeffery Fernandez
Hi all, Is it possible to rewind a foreach loop? eg: $numbers = array(0,1,2,3,4,5,6,7,8,9,10); foreach ($numbers as $index = $value) { if ($value == 5) { prev($numbers); } echo Value: $value . PHP_EOL; } The above doesn't seem to work. In one of

Re: [PHP] Rewind foreach loop

2007-11-29 Thread Jeffery Fernandez
I think the best option for me is to refactorise my code a bit to cater to my situation. Thanks all for your help. Jeffery On Fri, 30 Nov 2007 02:32:11 pm Jeffery Fernandez wrote: On Fri, 30 Nov 2007 02:13:52 pm Chris wrote: Jeffery Fernandez wrote: On Fri, 30 Nov 2007 02:01:47 pm Chris

Re: [PHP] Rewind foreach loop

2007-11-29 Thread Jeffery Fernandez
On Fri, 30 Nov 2007 02:01:47 pm Chris wrote: Jeffery Fernandez wrote: Hi all, Is it possible to rewind a foreach loop? eg: $numbers = array(0,1,2,3,4,5,6,7,8,9,10); foreach ($numbers as $index = $value) { if ($value == 5) { prev($numbers

Re: [PHP] Rewind foreach loop

2007-11-29 Thread Jeffery Fernandez
On Fri, 30 Nov 2007 02:13:52 pm Chris wrote: Jeffery Fernandez wrote: On Fri, 30 Nov 2007 02:01:47 pm Chris wrote: Jeffery Fernandez wrote: Hi all, Is it possible to rewind a foreach loop? eg: $numbers = array(0,1,2,3,4,5,6,7,8,9,10); foreach ($numbers as $index = $value

[PHP] Array Slice without loosing index

2007-11-27 Thread Jeffery Fernandez
Hi all, I am wanting to retain the array indexes after it being sliced. Here is what I have so far. if ($user_count $group_count) { for ($i = 0; $i $user_count; $i+=$group_count) { $output = array_slice($properties['users'], $i, $group_count);

Re: [PHP] Array Slice without loosing index [SOLVED]

2007-11-27 Thread Jeffery Fernandez
oops me bad.. I just needed the last (4th) parameter added. cheers, Jeffery On Wed, 28 Nov 2007 04:59:35 pm Jeffery Fernandez wrote: Hi all, I am wanting to retain the array indexes after it being sliced. Here is what I have so far. if ($user_count $group_count) { for ($i = 0; $i

[PHP] Generating sequence of AlphaNumber

2007-11-14 Thread Jeffery Fernandez
Hi all, I am having trouble generating a sequence of numbers from the following start value: AX0001 what I have done so far is loop through each character and check if its a alphabet and separating the characters and digits. But when I increment the digits, its strips of the leading zeros.

Re: [PHP] Generating sequence of AlphaNumber

2007-11-14 Thread Jeffery Fernandez
On Thu, 15 Nov 2007 11:48:07 am Stephen Edberg wrote: On Thu, 15 Nov 2007, Jeffery Fernandez wrote: Hi all, I am having trouble generating a sequence of numbers from the following start value: AX0001 what I have done so far is loop through each character and check if its

Re: [PHP] Problem with pasting text from word into php form

2007-10-01 Thread Jeffery Fernandez
On Monday 01 October 2007 16:01, Crab Hunt wrote: Hi, Is there a fix for removing the junk characters that appear when we copy and paste some text from Microsoft word into a php form ? For example the double quotes turn into something like *รข??* thanks in advance. Some WYSIWYG editors do

Re: [PHP] counting with leading zeros

2007-09-30 Thread Jeffery Fernandez
gee you guys behave like kids. don't you all have other things to do than whinge, swear and blame each other on the list? Take it elsewhere and sort it out. This is bad for the PHP community in general. It doesn't reflect what the community is about. my 2c. On Sunday 30 September 2007 13:47,

Re: [PHP] PHP and daylight savings

2007-09-30 Thread Jeffery Fernandez
On Monday 01 October 2007 10:08, Bruce Cowin wrote: Yet another update! I managed to get rid of the CGI error by turning off error logging to the syslog. But now I get this message: PHP Warning: PHP Startup: Unable to load dynamic library 'c:\php\ext\php_timezonedb.dll' - Access is denied.

Re: [PHP] SimpleXMLElement is not Simple

2007-09-30 Thread Jeffery Fernandez
On Friday 28 September 2007 11:21, Jeffery Fernandez wrote: On Friday 28 September 2007 11:09, Nathan Nobbe wrote: just curious, what database are you using? I am using MySQL Ver 14.12 Distrib 5.0.22 Any clues Nathan? I have done some further testing and found that if I copy the working

Re: [PHP] SimpleXMLElement is not Simple

2007-09-27 Thread Jeffery Fernandez
On Friday 28 September 2007 11:09, Nathan Nobbe wrote: just curious, what database are you using? I am using MySQL Ver 14.12 Distrib 5.0.22 cheers, Jeffery -nathan On 9/27/07, Jeffery Fernandez [EMAIL PROTECTED] wrote: I am having nightmares with this bit off code. The following code

[PHP] SimpleXMLElement is not Simple

2007-09-27 Thread Jeffery Fernandez
I am having nightmares with this bit off code. The following code work perfectly fine: $soap_request_string = XML ?xml version=1.0 encoding=UTF-8? env:Envelope xmlns:env=http://www.w3.org/2003/05/soap-envelope; xmlns:ns1=urn:Gateway_Proxy xmlns:xsd=http://www.w3.org/2001/XMLSchema;

[PHP] Extract SOAP Request Data

2007-09-26 Thread Jeffery Fernandez
I have a SOAP request logger which logs all SOAP requests/responses being made on the system. What I want to do is extract the function name being called and the params passed to it. The following is an example XML Request: ?xml version=1.0 encoding=UTF-8? env:Envelope

Re: [PHP] PDOStatement execute memory issue?

2007-09-26 Thread Jeffery Fernandez
On Thursday 27 September 2007 04:21, Carlton Whitehead wrote: Hi everyone, I'm working on a script that downloads archived fax images (TIFFs and PDFs) from a MS SQL Server using the PDO ODBC driver. I get the below error regardless of which fax I try to get from the database. Each fax is a

Re: [PHP] session_decode from session handler

2007-07-21 Thread Jeffery Fernandez
I have a similar problem I am facing with session data stored in the database from the set_session_handler. What I am trying to do is show a list of online users and the page they are currenlty viewing. For this purpose I am query the sessions table to get the list of session and from that I

Re: [PHP] session_decode from session handler

2007-07-21 Thread Jeffery Fernandez
On Sunday 22 July 2007 14:19, Jeffery Fernandez wrote: I have a similar problem I am facing with session data stored in the database from the set_session_handler. What I am trying to do is show a list of online users and the page they are currenlty viewing. For this purpose I am query

Re: [PHP] Drag 'n Drop - File Upload

2006-07-03 Thread Jeffery Fernandez
On Mon, 3 Jul 2006 11:09 pm, Mariano Guadagnini wrote: I've seen some places using a java applet for this. A good example is the course uploading interface of Blackboard LMS. Martin Staiger wrote: Dear group, we would like to have the possibility to upload files not via HTML-form but

Re: [PHP] PHP Frameworks

2005-03-13 Thread Jeffery Fernandez
Simon Reye wrote: I'm moving away from Cold Fusion and am considering java or php. I've mucked around with Struts and Coccoon on the java side and think they are great. There does not however seem to be any well backed projects similar to these for php. Can anyone point me to a good php MVC

Re: [PHP] How to Get URL?

2005-03-13 Thread Jeffery Fernandez
Labunski wrote: How to get url of the page the php script is on? In other words, I want to know whether I'm in page news.php or in posts.php, or in some other page. Is there any simple way to get tis info? Thanks, Lab. if (basename($_SERVER['PHP_SELF']) == 'news.php') { // do whatever

Re: [PHP] LibMcrypt and Mcrypt and Mhash - OH MY!

2005-02-11 Thread Jeffery Fernandez
Steven Altsman wrote: Ive beaten my head against the desk repeatedly, RTFMing until my eyes are sore, the boss is still at my back.. and Im completely lost. Id love to grok intricacies of compiling C code and setting environment variables.. but I am dead once February 15^th rolls around and

Re: [PHP] Magic Quotes

2005-02-10 Thread Jeffery Fernandez
Jochem Maas wrote: Ben Edwards (lists) wrote: Am I correct in thinking Magic Quotes automatically adds quotes to all posted variables, therefore if you are displaying post variables on a form you have to remove the quotes. They are only needed if you are actually inserting/updating into the

[PHP] array_map() problems

2005-02-07 Thread Jeffery Fernandez
I have the following 2 functions which I intend to clean GPC off slashes if magic_quotes_gpc is turned on. function StripGpcSlashes() { if (get_magic_quotes_gpc()) { $_POST = array_map('StripSlashesDeep', $_POST); $_GET = array_map('StripSlashesDeep', $_GET); $_COOKIE =

Re: [PHP] array_map() problems

2005-02-07 Thread Jeffery Fernandez
, Jeffery On Mon, 7 Feb 2005 17:10:32 -0600, Greg Donald [EMAIL PROTECTED] wrote: On Tue, 08 Feb 2005 09:37:11 +1100, Jeffery Fernandez [EMAIL PROTECTED] wrote: I have the following 2 functions which I intend to clean GPC off slashes if magic_quotes_gpc is turned on. function StripGpcSlashes

Re: [PHP] Displaying a html line as html

2005-01-31 Thread Jeffery Fernandez
Todd Cary wrote: I have the following: $p = a href=http://209.204.172.137/casesearch/php/home.php;Home/a However, when I have print($p); or echo $p; the result page does not display as a link; just as the text above. What have I missed? Todd try: ?php $p = 'a

Re: [PHP] sorting associative array

2005-01-24 Thread Jeffery Fernandez
; else if ( $x[$this-mArraySortKey] $y[$this-mArraySortKey] ) return 1; else return -1; } and within my class I am calling the following two lines: // Sort the array $this-mArraySortKey = 'score'; usort($this-mSearchData, array( $this, 'sort_array')); cheers, Jeffery

Re: [PHP] sorting associative array

2005-01-24 Thread Jeffery Fernandez
Jochem Maas wrote: Jeffery Fernandez wrote: Jochem Maas wrote: ... Yes the example sent by Kurt Yoder worked for me. I coudn't work out the errors with the class you sent me. I realised it was written for PHP5 in mind ?... or maybe I wasn't patient enough to spent time debugging it :-( I

[PHP] sorting associative array

2005-01-23 Thread Jeffery Fernandez
I have the following multi-dimentional array and I want to sort it by the score key value print_r($data); Array ( [0] = Array ( [video_id] = 71 [old_id] = 7854 [title] = When the fire comes [video_copies] = 1 [running_time] = 48

Re: [PHP] sorting associative array

2005-01-23 Thread Jeffery Fernandez
based on the score key.. looking at jochem's class now. Thanks Jeffery On Jan 23, 2005, at 8:39 AM, Jeffery Fernandez wrote: I have the following multi-dimentional array and I want to sort it by the score key value print_r($data); Array ( [0] = Array ( [video_id] = 71

Re: [PHP] sorting associative array

2005-01-23 Thread Jeffery Fernandez
Jochem Maas wrote: Jeffery Fernandez wrote: Kurt Yoder wrote: Use usort (stealing from php docs): function cmp($a['score'], $b['score']) { if ($a['score'] == $b['score']) { return 0; } return ($a['score'] $b['score']) ? -1 : 1; } $data = array(...); usort($data, cmp); This won't

[PHP] end of array

2005-01-22 Thread Jeffery Fernandez
Hi all, I have a foreach loop on an array and within that loop I need to find if the array has reached the last pointer. I have tried if (next($row)) { } but that advances the pointer. Any tips on finding out if the array pointer has reached the last element ? cheers, Jeffery -- PHP General

Re: [PHP] end of array

2005-01-22 Thread Jeffery Fernandez
Rasmus Lerdorf wrote: Jeffery Fernandez wrote: Hi all, I have a foreach loop on an array and within that loop I need to find if the array has reached the last pointer. I have tried if (next($row)) { } but that advances the pointer. Any tips on finding out if the array pointer has reached

Re: [PHP] Any idea when 4.3.11 will be released?

2005-01-16 Thread Jeffery Fernandez
Gal wrote: Hello, I'm Working in organization which also using php on the Windows platform. Because of the security holes in the older version and a COM bug at PHP 4.3.10 (http://bugs.php.net/bug.php?id=31159) we are using a problematic version. Does anyone here knows - what is the status of

Re: [PHP] Re: How to set an absolute include path?

2004-12-27 Thread Jeffery Fernandez
Brian Dunning wrote: I should add that I'd heard that the following will set the include_path to the server root, no matter where you call includes from: ini_set (include_path, ini_get (include_path) . ':../:../../:../../../:../../../../'); But this doesn't seem to be doing it for me. Also

Re: [PHP] IDE recommendation-- (Free?)

2004-12-17 Thread Jeffery Fernandez
Mat Harris wrote: On Fri, Dec 17, 2004 at 08:20:36 -0500, GH wrote: Hi... I am looking for a FREE PHP IDE that uses syntax highlighting and code completion amongst other features... Do any of you have any recommendations... again I am looking for FREE (not much budget for me)? I use BOTH Linux

[PHP] logic with arrays

2004-12-15 Thread Jeffery Fernandez
I am trying to build a html menu dynamically from data sitting in an array. I have been successful so far until it came to the point of populating the sub-menu of the system. Can someone help me out with the logic or is there a simpler way of doing it? Thanks ?php /** * This function builds

Re: [PHP] logic with arrays

2004-12-15 Thread Jeffery Fernandez
Wee Keat wrote: Hey Jeff, How are you mate? Was lazying around and saw your email to the list. :) What exactly do you need help with? Is it the following line? // Stuck here $html_menu .= lia href=\Need to get value\$sub_page/a/li; } $html_menu .= '/ul'; Do you

[PHP] HTTP Authenticate via PHP

2004-11-29 Thread Jeffery Fernandez
Hi, I am trying to find out if its possible to authenticate a page against an HTTP authentication. Basically what I am trying to do is make available the stats page of the Cpanel to the admin interface of a site. When accessing the stats via the cpanel the user needs to login via http

Re: [PHP] Re: intalling pear:db

2004-11-24 Thread Jeffery Fernandez
Merlin wrote: Greg Beaver wrote: Merlin wrote: Hi there, I am trying to get a class running which requires pear:DB. I downloaded the package and executed: # pear install DB-1.6.8.tgz DB already installed pear upgrade DB-1.6.8.tgz Hi, I successfully upgraded with this command. However the system

Re: [PHP] inline_C installation

2004-11-21 Thread Jeffery Fernandez
Burhan Khalid wrote: Rayan Lahoud wrote: Does anybody knows how to install a pear package. i have the inline_C package that i want to install and use. And can i have some sample functions using this package? pear install Inline_C -- that's it. You don't need to restart Apache, or load any

Re: [PHP] Re: ending a session

2004-11-20 Thread Jeffery Fernandez
Greg Donald wrote: On Sat, 20 Nov 2004 13:52:32 -0800, Jed Smith [EMAIL PROTECTED] wrote: PHP attached to different Apaches can't share sessions, AFAIK. You'll need to make sure it's the same copy of Apache, listening on both ports The simplest solution is to use database managed PHP

Re: [PHP] PHP Supremacy...

2004-11-17 Thread Jeffery Fernandez
Octavian Rasnita wrote: What do you mean by perl discontinued? Perl 5 is continuu updated and this year I have seen perl 5.8.1, 5.8.3, 5.8.4, 5.8.5 is almost done. That was meant to be a JOKE lol Perl 6 is planned to run in a precompiled code (like Java programs) in an environment that will