Re: [PHP] What is the difference between the two streams 5.3 and 5.2 versions and What is the need for maintaining two streams?

2010-01-05 Thread Daniel Egeberg
On Tue, Jan 5, 2010 at 10:34, Daniel Egeberg wrote: > On Tue, Jan 5, 2010 at 02:22, Varuna Seneviratna wrote: >> Since there are two stable versions 5.3 and 5.2 .What is the difference >> between these two streams and What is the need for maintaining two streams? > > The PHP 5.3.x branch is still

[PHP] Luhn (modulo 10) check digit calculator

2010-01-05 Thread Angus Mann
Hi all. Perhaps a lazy request, but does anybody have some cut-n-paste code to calculate a Luhn check-digit? It's a check-digit often added to the end of things like credit card or account numbers to make detecting typo's a bit easier. I found lots of code to validate a number once the check-di

Re: [PHP] Luhn (modulo 10) check digit calculator

2010-01-05 Thread Per Jessen
Angus Mann wrote: > Hi all. Perhaps a lazy request, but does anybody have some cut-n-paste > code to calculate a Luhn check-digit? > http://de.wikipedia.org/wiki/Luhn-Algorithmus (several examples, including one in PHP). /Per -- Per Jessen, Zürich (0.0°C) -- PHP General Mailing List (http

Re: [PHP] Luhn (modulo 10) check digit calculator

2010-01-05 Thread Richard Quadling
2010/1/5 Angus Mann : > Hi all. Perhaps a lazy request, but does anybody have some cut-n-paste code > to calculate a Luhn check-digit? > > It's a check-digit often added to the end of things like credit card or > account numbers to make detecting typo's a bit easier. > > I found lots of code to v

Re: [PHP] Luhn (modulo 10) check digit calculator

2010-01-05 Thread Richard Quadling
2010/1/5 Richard Quadling : > 2010/1/5 Angus Mann : >> Hi all. Perhaps a lazy request, but does anybody have some cut-n-paste code >> to calculate a Luhn check-digit? >> >> It's a check-digit often added to the end of things like credit card or >> account numbers to make detecting typo's a bit ea

[PHP] splitting a string

2010-01-05 Thread Ingleby, Les
Hi all, first time I have posted here so please be nice. I am using PEAR HTTP_Upload to handle multiple file uploads. What I need to do is to take the file name which is output using the getProp() function and then remove the file extension from the end of the file for example: Original name he

Re: [PHP] splitting a string

2010-01-05 Thread Daniel Egeberg
On Tue, Jan 5, 2010 at 13:39, Ingleby, Les wrote: > Hi all, first time I have posted here so please be nice. > > I am using PEAR HTTP_Upload to handle multiple file uploads. What I need to > do is to take the file name which is output using the getProp() function and > then remove the file exten

Re: [PHP] splitting a string

2010-01-05 Thread Ashley Sheridan
On Tue, 2010-01-05 at 12:39 +, Ingleby, Les wrote: > Hi all, first time I have posted here so please be nice. > > I am using PEAR HTTP_Upload to handle multiple file uploads. What I need to > do is to take the file name which is output using the getProp() function and > then remove the file

Re: [PHP] splitting a string

2010-01-05 Thread Daniel Egeberg
On Tue, Jan 5, 2010 at 14:13, Ashley Sheridan wrote: > (untested - I always forget the order of the params!) As a general rule, string functions are always haystack-needle and array functions are always needle-haystack. I can't think of any exceptions to that rule. -- Daniel Egeberg -- PHP Ge

Re: [PHP] splitting a string

2010-01-05 Thread Ashley Sheridan
On Tue, 2010-01-05 at 14:26 +0100, Daniel Egeberg wrote: > On Tue, Jan 5, 2010 at 14:13, Ashley Sheridan > wrote: > > (untested - I always forget the order of the params!) > > As a general rule, string functions are always haystack-needle and > array functions are always needle-haystack. I can'

[PHP] Re: splitting a string

2010-01-05 Thread Shawn McKenzie
Ingleby, Les wrote: > Hi all, first time I have posted here so please be nice. > > I am using PEAR HTTP_Upload to handle multiple file uploads. What I need to > do is to take the file name which is output using the getProp() function and > then remove the file extension from the end of the file

Re: [PHP] Re: splitting a string

2010-01-05 Thread Ashley Sheridan
On Tue, 2010-01-05 at 08:45 -0600, Shawn McKenzie wrote: > Ingleby, Les wrote: > > Hi all, first time I have posted here so please be nice. > > > > I am using PEAR HTTP_Upload to handle multiple file uploads. What I need to > > do is to take the file name which is output using the getProp() func

Re: [PHP] Re: splitting a string

2010-01-05 Thread Richard Quadling
2010/1/5 Ashley Sheridan : > On Tue, 2010-01-05 at 08:45 -0600, Shawn McKenzie wrote: > >> Ingleby, Les wrote: >> > Hi all, first time I have posted here so please be nice. >> > >> > I am using PEAR HTTP_Upload to handle multiple file uploads. What I need >> > to do is to take the file name which

Re: [PHP] Re: splitting a string

2010-01-05 Thread Shawn McKenzie
Ashley Sheridan wrote: > On Tue, 2010-01-05 at 08:45 -0600, Shawn McKenzie wrote: > >> Ingleby, Les wrote: >>> Hi all, first time I have posted here so please be nice. >>> >>> I am using PEAR HTTP_Upload to handle multiple file uploads. What I need to >>> do is to take the file name which is outp

RE: [PHP] Re: splitting a string

2010-01-05 Thread Ingleby, Les
Hi everyone, thanks so much for your help. The pathinfo($filename, PATHINFO_FILENAME); works a treat for me, since I am dealing and will only be dealing with a word doc then this is awesome. Still new to PHP but self taught and scripting is coming on hence I don't know many functions just yet.

Re: [PHP] Re: splitting a string

2010-01-05 Thread Richard Quadling
2010/1/5 Ingleby, Les : > Hi everyone, thanks so much for your help. The pathinfo($filename, > PATHINFO_FILENAME); works a treat for me, since I am dealing and will only be > dealing with a word doc then this is awesome. > > Still new to PHP but self taught and scripting is coming on hence I don'

Re: [PHP] Re: splitting a string

2010-01-05 Thread Daniel Egeberg
On Tue, Jan 5, 2010 at 16:09, Shawn McKenzie wrote: > Of course this doesn't work for something like 'My.Word.Document.docx' > or 'archive_v2.0.1.tar.gz', but I don't know what will with extensions > being variable length and possibly composed of multiple periods. I suppose a solution to that cou

Re: [PHP] Re: splitting a string

2010-01-05 Thread Ashley Sheridan
On Tue, 2010-01-05 at 16:18 +0100, Daniel Egeberg wrote: > On Tue, Jan 5, 2010 at 16:09, Shawn McKenzie wrote: > > Of course this doesn't work for something like 'My.Word.Document.docx' > > or 'archive_v2.0.1.tar.gz', but I don't know what will with extensions > > being variable length and possib

Re: [PHP] Re: splitting a string

2010-01-05 Thread Andrew Ballard
On Tue, Jan 5, 2010 at 10:20 AM, Ashley Sheridan wrote: > On Tue, 2010-01-05 at 16:18 +0100, Daniel Egeberg wrote: > >> On Tue, Jan 5, 2010 at 16:09, Shawn McKenzie wrote: >> > Of course this doesn't work for something like 'My.Word.Document.docx' >> > or 'archive_v2.0.1.tar.gz', but I don't know

Re: [PHP] Re: splitting a string

2010-01-05 Thread Shawn McKenzie
Andrew Ballard wrote: > On Tue, Jan 5, 2010 at 10:20 AM, Ashley Sheridan > wrote: >> On Tue, 2010-01-05 at 16:18 +0100, Daniel Egeberg wrote: >> >>> On Tue, Jan 5, 2010 at 16:09, Shawn McKenzie wrote: Of course this doesn't work for something like 'My.Word.Document.docx' or 'archive_v2.

RE: [PHP] Re: splitting a string

2010-01-05 Thread Bob McConnell
From: Shawn McKenzie [mailto:nos...@mckenzies.net] > Andrew Ballard wrote: >> On Tue, Jan 5, 2010 at 10:20 AM, Ashley Sheridan >> wrote: >>> On Tue, 2010-01-05 at 16:18 +0100, Daniel Egeberg wrote: >>> On Tue, Jan 5, 2010 at 16:09, Shawn McKenzie wrote: > Of course this doesn't work for

Re: [PHP] If design patterns are not supposed to produce reusable code then why use them?

2010-01-05 Thread Bipper Goes!
A pattern is simply a device used to skip out on costly dollars (as opposed to cheap dollars). Software development is a low loyalties field. When new workers come in and old ones are laid off, or when the project is complete and you will likely not be working on the project again in the future,

[PHP] SVG and PHP

2010-01-05 Thread Alice Wei
Hi, Just went online and saw an SVG generated from Python, and wanted to do the similar thing by loading the SVG into an PHP script. Here is the script that I have: The problem is that my screen appears as blank even though I could open up USA_Counties_with_FIPS_and_names.svg and see th

Re: [PHP] SVG and PHP

2010-01-05 Thread Bruno Fajardo
2010/1/5 Alice Wei > > Hi, > > Just went online and saw an SVG generated from Python, and wanted to do > the similar thing by loading the SVG into an PHP script. Here is the script > that I have: > > > #Load the Map > $ourFileName= "USA_Counties_with_FIPS_and_names.svg"; > $fh = fopen($ourFileN

Re: [PHP] SVG and PHP

2010-01-05 Thread Ashley Sheridan
On Tue, 2010-01-05 at 14:57 -0500, Alice Wei wrote: > Hi, > > Just went online and saw an SVG generated from Python, and wanted to do the > similar thing by loading the SVG into an PHP script. Here is the script that > I have: > > > #Load the Map > $ourFileName= "USA_Counties_with_FIPS_

RE: [PHP] SVG and PHP

2010-01-05 Thread Alice Wei
Hi, Just went online and saw an SVG generated from Python, and wanted to do the similar thing by loading the SVG into an PHP script. Here is the script that I have: The problem is that my screen appears as blank even though I could open up USA_Counties_with_FIPS_and_names.svg and

RE: [PHP] SVG and PHP

2010-01-05 Thread Ashley Sheridan
On Tue, 2010-01-05 at 15:15 -0500, Alice Wei wrote: > > > Hi, > > > > Just went online and saw an SVG generated from Python, and wanted to do the > similar thing by loading the SVG into an PHP script. Here is the script that > I have: > > > > > > > #Load the Map > > $ourFileName=

RE: [PHP] SVG and PHP

2010-01-05 Thread Alice Wei
On Tue, 2010-01-05 at 15:15 -0500, Alice Wei wrote: Hi, Just went online and saw an SVG generated from Python, and wanted to do the similar thing by loading the SVG into an PHP script. Here is the script that I have: The problem is that my screen appears as blank eve

[PHP] How to get a string from C library into PHP via SWIG?

2010-01-05 Thread Eric Fowler
I have a need to call a C language function from a PHP script. The function, which I wrote, looks like this: /* * foo(): Takes a string in sIn and writes another string into sOut according to what is passed in, and the * value at *pcch. Will not write more than *pcch bytes to output, including nu

Re: [PHP] How to get a string from C library into PHP via SWIG?

2010-01-05 Thread Ashley Sheridan
On Tue, 2010-01-05 at 13:29 -0800, Eric Fowler wrote: > I have a need to call a C language function from a PHP script. > > The function, which I wrote, looks like this: > > /* > * foo(): Takes a string in sIn and writes another string into sOut > according to what is passed in, and the > * value

Re: [PHP] How to get a string from C library into PHP via SWIG?

2010-01-05 Thread Eric Fowler
Hm, that could work, but it does produce overhead. Thank you. Eric On Tue, Jan 5, 2010 at 1:29 PM, Ashley Sheridan wrote: > > On Tue, 2010-01-05 at 13:29 -0800, Eric Fowler wrote: > > I have a need to call a C language function from a PHP script. > > The function, which I wrote, looks like this

Re: [PHP] How to get a string from C library into PHP via SWIG?

2010-01-05 Thread Nathan Nobbe
On Tue, Jan 5, 2010 at 3:42 PM, Eric Fowler wrote: > Hm, that could work, but it does produce overhead. > you should consider your overall communication paradigm. im very loosely familiar w/ swig, basically ive heard of it ... anyways, you have a few options for communication, . shell (call p

Re: [PHP] How to get a string from C library into PHP via SWIG?

2010-01-05 Thread Nathan Nobbe
On Tue, Jan 5, 2010 at 4:05 PM, Eric Fowler wrote: > I have a software library that parses strings into a C language > structure. It is a utility for C programmers. > > It contains a utility function that takes the output structure and > formats it as a string for display. > > The goal is to demo

Re: [PHP] How to get a string from C library into PHP via SWIG?

2010-01-05 Thread Eric Fowler
This is going to the list per Nathan's suggestion. I confess I am doing this the hard way because I want to get a handle on how to pass across that boundary. My current angle of attack is to use the malloc.i functions in swig to handle those strings. I will keep you all posted. I know you care.

Re: [PHP] How to get a string from C library into PHP via SWIG?

2010-01-05 Thread Eric Fowler
A little more information: my crashes all relate to handling the char datatype. Floats and ints are happy. I suspect that a char type in PHP is not the same as a char type in C. But I am not sure at all. More recently I have used cmalloc.i to allocate arrays of chars and floats. The floats are ha

[PHP] PHP has encountered an Access Violation at ***

2010-01-05 Thread Slack-Moehrle
Hi All, Win 2003, PHP 5.2.12 and IIS 6. I have PHP configured as ISSAPI and it is serving PHP pages. When I try a page that requires MySQL I am getting just: PHP has encountered an Access Violation at (and a RANDOM number) What does this mean? I have mysql extension uncommented in php.ini, iU

Re: [PHP] PHP has encountered an Access Violation at ***

2010-01-05 Thread Robert Cummings
Slack-Moehrle wrote: Hi All, Win 2003, PHP 5.2.12 and IIS 6. I have PHP configured as ISSAPI and it is serving PHP pages. When I try a page that requires MySQL I am getting just: PHP has encountered an Access Violation at (and a RANDOM number) It means you didn't follow the instructions on

Re: [PHP] How to get a string from C library into PHP via SWIG?

2010-01-05 Thread Nathan Nobbe
On Tue, Jan 5, 2010 at 4:38 PM, Eric Fowler wrote: > A little more information: my crashes all relate to handling the char > datatype. Floats and ints are happy. > > I suspect that a char type in PHP is not the same as a char type in C. > But I am not sure at all. > > More recently I have used cm

Re: [PHP] How to get a string from C library into PHP via SWIG?

2010-01-05 Thread Eric Fowler
I will expose only one function, prototyped like the foo() example I described. cstring.i is not implemented for a PHP target (wah). I think I will go the shell approach. I have enough time in this already. Eric On Tue, Jan 5, 2010 at 6:26 PM, Nathan Nobbe wrote: > On Tue, Jan 5, 2010 at 4:38

[PHP] pass by reference variable length args

2010-01-05 Thread viraj
hi all, i'm trying to write a wrapper function for "mysqli_stmt_bind_results". and expect it to work the same way it accepts and bind results to the original function. the problem is, i couldn't find a way to pass the args by reference via func_get_args and register the out put from call_user_func

Re: [PHP] pass by reference variable length args

2010-01-05 Thread Robert Cummings
viraj wrote: hi all, i'm trying to write a wrapper function for "mysqli_stmt_bind_results". and expect it to work the same way it accepts and bind results to the original function. the problem is, i couldn't find a way to pass the args by reference via func_get_args and register the out put from

Re: [PHP] pass by reference variable length args

2010-01-05 Thread viraj
thanks rob! here goes the working method. public function bind_result(&$arg1=null,&$arg2=null,&$arg3=null) { $numArgs = func_num_args(); $args = array(); for ($i=1; $i<= $numArgs; $i++) { $args['arg' . $i] = &${'arg'.$i};

Re: [PHP] pass by reference variable length args

2010-01-05 Thread viraj
if func_get_args supports pass by reference, we could have avoid the loop and pre-defined arg list. something like.. extract(func_get_args) :D cheers! ~viraj On Wed, Jan 6, 2010 at 11:04 AM, viraj wrote: > thanks rob! > > here goes the working method. > > public function bind_result(&$arg1=

Re: [PHP] pass by reference variable length args

2010-01-05 Thread Robert Cummings
viraj wrote: if func_get_args supports pass by reference, we could have avoid the loop and pre-defined arg list. something like.. extract(func_get_args) :D Absolute! I'm not sure why there isn't some kind of way to retrieve a reference in this manner, but I suspect it's related to knowing

[PHP] After editing only the httpd.conf PHP 5.2.12 works in Apache2.2 on WindowsXP Professional 2002 SP 3, Can this be?

2010-01-05 Thread Varuna Seneviratna
I Edited only the httpd.conf file and the changes I made were Added: LoadModule php5_module "C:/PHP/php-5.2.12/php5apache2_2.dll" Changed DocumentRoot and Directory from htdocs to test: DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/test" and Added the following AddType app

Re: [PHP] After editing only the httpd.conf PHP 5.2.12 works in Apache2.2 on WindowsXP Professional 2002 SP 3, Can this be?

2010-01-05 Thread Jim Lucas
Varuna Seneviratna wrote: I Edited only the httpd.conf file and the changes I made were Added: LoadModule php5_module "C:/PHP/php-5.2.12/php5apache2_2.dll" Yes, this is completely do-able. If php cannot find a php.ini file, it uses the defaults it was compiled with. Changed DocumentRoot a