[PHP] str_replace around a character??

2011-07-13 Thread Karl DeSaulniers
Hello All, I am needing some assistance. I am trying to add some Cc and Bcc to a mail script I have. On the form I have instructions for each to be separated by a comma + a space. In an all perfect world each user would do this perfectly. ...but since were working with something different,

Re: [PHP] str_replace around a character??

2011-07-13 Thread Jay Ess
On 2011-07-13 09:54, Karl DeSaulniers wrote: $cc = ema...@domain.com ,ema...@doamin.com,ema...@domain.com , ema...@domain.com, $cc = trim($cc,,); $result = preg_replace('/(\s?)(,)(\s?)/i', ',', $cc); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] str_replace around a character??

2011-07-13 Thread Vitalii Demianets
On Wednesday 13 July 2011 11:09:45 Jay Ess wrote: On 2011-07-13 09:54, Karl DeSaulniers wrote: $cc = ema...@domain.com ,ema...@doamin.com,ema...@domain.com , ema...@domain.com, $cc = trim($cc,,); $result = preg_replace('/(\s?)(,)(\s?)/i', ',', $cc); The solution is broken because of: 1)

Re: [PHP] str_replace around a character??

2011-07-13 Thread Jay Ess
On 2011-07-13 10:36, Vitalii Demianets wrote: On Wednesday 13 July 2011 11:09:45 Jay Ess wrote: On 2011-07-13 09:54, Karl DeSaulniers wrote: $cc = ema...@domain.com ,ema...@doamin.com,ema...@domain.com , ema...@domain.com, $cc = trim($cc,,); $result = preg_replace('/(\s?)(,)(\s?)/i', ',',

Re: [PHP] str_replace around a character??

2011-07-13 Thread Shiplu Mokaddim
If you are looking for a one liner reg ex, it may take some time. This may lead wasting your development time. Better you do the following, 1. replace the string with tokens in address. 2. Split using comma. 3. Apply common email regex. 4. Replace tokens with actual strings. 5. Rebuild/join the

Re: [PHP] Re: Serveside Printing w/ PHP

2011-07-13 Thread Marc Guay
What type of file are you trying to print? HTML. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Serveside Printing w/ PHP

2011-07-13 Thread Marc Guay
What type of file are you trying to print?  I'm not very familiar with Microsoft Windows but I know a little about it.  Have you considered Windows Powershell?  Unfortunately you would essentially have to write a powershell script and use the PHP exec functions.  Windows 7 shipped with

Re: [PHP] Re: Serveside Printing w/ PHP

2011-07-13 Thread Marc Guay
What type of file are you trying to print?  I'm not very familiar with Microsoft Windows but I know a little about it.  Have you considered Windows Powershell?  Unfortunately you would essentially have to write a powershell script and use the PHP exec functions.  Windows 7 shipped with

[PHP] Re: str_replace around a character??

2011-07-13 Thread Shawn McKenzie
On 07/13/2011 02:54 AM, Karl DeSaulniers wrote: Hello All, I am needing some assistance. I am trying to add some Cc and Bcc to a mail script I have. On the form I have instructions for each to be separated by a comma + a space. In an all perfect world each user would do this perfectly.

Re: [PHP] Re: str_replace around a character??

2011-07-13 Thread Florian Lemaitre
Le 13/07/2011 16:59, Shawn McKenzie a écrit : On 07/13/2011 02:54 AM, Karl DeSaulniers wrote: Hello All, I am needing some assistance. I am trying to add some Cc and Bcc to a mail script I have. On the form I have instructions for each to be separated by a comma + a space. In an all perfect

[PHP] What is a label?

2011-07-13 Thread Tim Streater
Looking over the definition of a function today I see: Function names follow the same rules as other labels in PHP. but I can't find the definition of a label anywhere. I can't see it listed in the contents - have I overlooked it? If not, how can I request the the doccy be updated? Tim

[PHP] Re: str_replace around a character??

2011-07-13 Thread Karl DeSaulniers
On Jul 13, 2011, at 9:59 AM, Shawn McKenzie wrote: On 07/13/2011 02:54 AM, Karl DeSaulniers wrote: Hello All, I am needing some assistance. I am trying to add some Cc and Bcc to a mail script I have. On the form I have instructions for each to be separated by a comma + a space. In an all

Re: [PHP] What is a label?

2011-07-13 Thread Micky Hulse
They must mean labels as in general naming convention rules for programming... Like not naming a variable/function label with a number at the front. Here's a page about variables: http://www.php.net/manual/en/language.variables.basics.php Variable names follow the same rules as other labels in

Re: Re: [PHP] What is a label?

2011-07-13 Thread Tim Streater
On 13 Jul 2011 at 22:39, Micky Hulse rgmi...@gmail.com wrote: They must mean labels as in general naming convention rules for programming... Like not naming a variable/function label with a number at the front. Here's a page about variables:

[PHP] Most popular word sorting

2011-07-13 Thread Ron Piggott
Is it possible in PHP to sort an array by most frequently occurring word / phrase, 2nd most frequently occurring, third, etc. An example array is: Array ( [1] = Parable [2] = Mustard [3] = Seed [4] = Parable [5] = Good [6] = Samaritan [7] = Parable [8] = Workers [9] = Vineyard [10] = Parable

[PHP] Your language sucks because...

2011-07-13 Thread Daevid Vincent
(at the risk of starting another $h!t storm like the last time) http://wiki.theory.org/YourLanguageSucks#PHP_sucks_because: ;-)

Re: [PHP] Most popular word sorting

2011-07-13 Thread Stuart Dallas
On Wednesday, 13 July 2011 at 23:30, Ron Piggott wrote: Is it possible in PHP to sort an array by most frequently occurring word / phrase, 2nd most frequently occurring, third, etc. An example array is: Array ( [1] = Parable [2] = Mustard [3] = Seed [4] = Parable [5] = Good [6] =

Re: [PHP] Your language sucks because...

2011-07-13 Thread Micky Hulse
Under the CSS section: No way to modularize or programmatically generate lengths. Can't say: { width:50% - 2px; } That's so true!! I wish I could do the above... Oh, and why is the PHP section so damned long?!? Good read, thanks. :) -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Your language sucks because...

2011-07-13 Thread Lester Caine
Daevid Vincent wrote: (at the risk of starting another $h!t storm like the last time) http://wiki.theory.org/YourLanguageSucks#PHP_sucks_because: Perhaps when they get around to checking the facts ... most of the content will be deleted? A number of the -ve's I'd personally flag as +ve's and

RE: [PHP] Your language sucks because...

2011-07-13 Thread Florian Müller
Well . do you have any hobbies or such? I think if you like it to complain about languages sucking and so on, please do NOT spam this mailing list with this really USELESS content. There are some people out there who are using these languages for some good reasons, and I guess they give a

Re: [PHP] PHP control structure

2011-07-13 Thread Tamara Temple
On Jul 12, 2011, at 10:11 PM, Chris Stinemetz wrote: Hey all, I would like to add an if statement to the following function so that the value 1 is assigned corporate and the value is 2 assign standard to it. Would you show me an example on adding it to the below function? If there is a

RE: [PHP] Your language sucks because...

2011-07-13 Thread Alex Nikitin
I'm actually interested in finding out if there are any languages that don't suck in any way... I know and have programmed in about 29, i have yet to find a language that makes 100% sense and i have no complaints about. However i still choose PHP over many, many other languages and i implement php

[PHP] Report generation as pdf and csv in php application for huge record set

2011-07-13 Thread Midhun Girish
Hi all, I have an erp application developed in php (zend framework actually). There are many reports which the admin level users can take from the application. Some reports have more than 600,000 records. The viewing of reports in the browser is fine as i have paginated the result. But when it

Re: [PHP] PHP control structure

2011-07-13 Thread Negin Nickparsa
if the problem is only the assigning it's an example: in mysql you can have this one: create table store_list(id_markets int auto_increment,store_type int,primary key(id_markets)); and for page this one: html head titleStore/title /head form method=post ?php

[PHP] IF stream lining

2011-07-13 Thread Ron Piggott
Is there a way to stream line this: if ( ( $val with ) AND ( $val from ) ) { Ron The Verse of the Day “Encouragement from God’s Word” http://www.TheVerseOfTheDay.info

Re: [PHP] IF stream lining

2011-07-13 Thread Alex Nikitin
if( $val !== with $val !== from) simple comparison = faster solution... also you want type-safe you could do something like if(!in_array($val, array(from,with))) but its neither elegant nor fast On Jul 14, 2011 12:22 AM, Ron Piggott ron.pigg...@actsministries.org wrote:

Re: [PHP] Report generation as pdf and csv in php application for huge record set

2011-07-13 Thread George Langley
On 2011-07-13, at 9:59 PM, Midhun Girish wrote: I have an erp application developed in php (zend framework actually). There are many reports which the admin level users can take from the application. Some reports have more than 600,000 records. The viewing of reports in the browser is fine

Re: [PHP] Report generation as pdf and csv in php application for huge record set

2011-07-13 Thread Midhun Girish
Hi, - Browsers generally have a 5 minute time-out. If you send the PDF directly to the browser and reach the limit, it will be lost. It is therefore advised for very big documents to generate them in a file, and to send some data to the browser from time to time (with a call to flush() to

Re: [PHP] Report generation as pdf and csv in php application for huge record set

2011-07-13 Thread George Langley
On 2011-07-13, at 11:20 PM, Midhun Girish wrote: Hi, - Browsers generally have a 5 minute time-out. If you send the PDF directly to the browser and reach the limit, it will be lost. It is therefore advised for very big documents to generate them in a file, and to send some data to the