php-general Digest 2 Apr 2010 23:05:23 -0000 Issue 6672

2010-04-02 Thread php-general-digest-help
php-general Digest 2 Apr 2010 23:05:23 - Issue 6672 Topics (messages 303749 through 303755): str_replace help 303749 by: David Stoltz 303750 by: Ashley Sheridan 303751 by: Midhun Girish 303752 by: Nilesh Govindarajan SimpleXMLElement and gb2312 or big5

Re: [PHP] How to know which PHP is used by Apache

2010-04-02 Thread Devendra Jadhav
On Thu, Apr 1, 2010 at 11:30 PM, Nilesh Govindarajan li...@itech7.comwrote: On 04/01/10 23:03, Kevin Kinsey wrote: Nilesh Govindarajan wrote: libphp5.so doesn't need the php binary. You're right, and of course not. libphp5.so *is* a PHP binary :-) I've confirmed this using a test.

[PHP] str_replace help

2010-04-02 Thread David Stoltz
Hi folks, In ASP, I would commonly replace string line feeds for HTML output like this: Var = replace(value,vbcrlf,br) In PHP, the following doesn't seem to work: $var = str_replace(chr(13),\n,$value) Neither does: $var = str_replace(chr(10),\n,$value) What am I doing wrong? Thanks!

Re: [PHP] str_replace help

2010-04-02 Thread Ashley Sheridan
On Fri, 2010-04-02 at 09:28 -0400, David Stoltz wrote: Hi folks, In ASP, I would commonly replace string line feeds for HTML output like this: Var = replace(value,vbcrlf,br) In PHP, the following doesn't seem to work: $var = str_replace(chr(13),\n,$value) Neither does: $var =

Re: [PHP] str_replace help

2010-04-02 Thread Midhun Girish
well david actually $var = str_replace(chr(13),\n,$value) will replace char(13) with \n... but \n wont come up in html unless u give a pre tag.. u need to put $var = str_replace(chr(13),br/,$value) in order to got the required output Midhun Girish On Fri, Apr 2, 2010 at 7:03 PM, Ashley

Re: [PHP] str_replace help

2010-04-02 Thread Nilesh Govindarajan
On 04/02/10 18:58, David Stoltz wrote: Hi folks, In ASP, I would commonly replace string line feeds for HTML output like this: Var = replace(value,vbcrlf,br) In PHP, the following doesn't seem to work: $var = str_replace(chr(13),\n,$value) Neither does: $var = str_replace(chr(10),\n,$value)

[PHP] SimpleXMLElement and gb2312 or big5

2010-04-02 Thread Peter Pei
I use the following code to get rss and parse it, but the code occasionally have issues with gb2312 or big-5 encoded feeds, and fails to parse them. However other times may appear just okay. Any thoughts? Maybe SimpleXMLElement is simply not meant for other language encodings...

[PHP] SimpleXMLElement occasionally fails to parse gb2312 or big5 feeds

2010-04-02 Thread Peter Pei
I use the following code to get rss and parse it, but the code occasionally have issues with gb2312 or big-5 encoded feeds, and fails to parse them. However other times may appear just okay. Any thoughts? Maybe SimpleXMLElement is simply not meant for other language encodings...

[PHP] convert a string into an array

2010-04-02 Thread Andre Polykanine
Hello everyone, It's quite simple but I'm still stuck. What I need is the following: I have an array as a parameter of my custom function. However, I'd like to allow users to enter a string instead of an array. In this case (if the parameter is a string), it must be replaced with an array

[PHP] preg_match? Or something else?

2010-04-02 Thread Ashley M. Kirchner
I have an array that's created as follows: $string = 73G146C 311- 309.1C; $arr = preg_split(/[\s]+/, $string); Now I need to take each element in that array, and break them up even further so that I get: 73G= 73 and G 146C = 146 and C 311- = 311 and - 309.1C =

Re: [PHP] convert a string into an array

2010-04-02 Thread Jim Lucas
Andre Polykanine wrote: Hello everyone, It's quite simple but I'm still stuck. What I need is the following: I have an array as a parameter of my custom function. However, I'd like to allow users to enter a string instead of an array. In this case (if the parameter is a string), it must be

[PHP] Re: convert a string into an array

2010-04-02 Thread Nathan Rixham
Andre Polykanine wrote: Hello everyone, It's quite simple but I'm still stuck. What I need is the following: I have an array as a parameter of my custom function. However, I'd like to allow users to enter a string instead of an array. In this case (if the parameter is a string), it must be

Re: [PHP] preg_match? Or something else?

2010-04-02 Thread Jim Lucas
Ashley M. Kirchner wrote: I have an array that's created as follows: $string = 73G146C 311- 309.1C; $arr = preg_split(/[\s]+/, $string); Now I need to take each element in that array, and break them up even further so that I get: 73G= 73 and G 146C =

Re: [PHP] preg_match? Or something else?

2010-04-02 Thread Nathan Rixham
Jim Lucas wrote: Ashley M. Kirchner wrote: I have an array that's created as follows: $string = 73G146C 311- 309.1C; Anyone want to take a stab at it? Conditionals are your friend! plaintext?php $string = 73G146C 311- 309.1C; $arr = preg_split(/[\s]+/,

[PHP] array or list of objects of different types

2010-04-02 Thread Php Developer
Hi all, I want to be able to have an array of elements of different types. As an example: the first element is a boolean, the second is an integer, and the thirs is a string. In php there is no typing, i'm just wondering if there is a way to have that, it would be a lot better than having an

[PHP] Re: array or list of objects of different types

2010-04-02 Thread Nathan Rixham
Php Developer wrote: Hi all, I want to be able to have an array of elements of different types. As an example: the first element is a boolean, the second is an integer, and the thirs is a string. In php there is no typing, i'm just wondering if there is a way to have that, it would be

Re: [PHP] Re: convert a string into an array

2010-04-02 Thread Nilesh Govindarajan
On 04/03/10 04:56, Nathan Rixham wrote: Andre Polykanine wrote: Hello everyone, It's quite simple but I'm still stuck. What I need is the following: I have an array as a parameter of my custom function. However, I'd like to allow users to enter a string instead of an array. In this case (if

Re: [PHP] Re: array or list of objects of different types

2010-04-02 Thread Nilesh Govindarajan
On 04/03/10 05:42, Nathan Rixham wrote: Php Developer wrote: Hi all, I want to be able to have an array of elements of different types. As an example: the first element is a boolean, the second is an integer, and the thirs is a string. In php there is no typing, i'm just wondering if there