php-general Digest 14 Oct 2009 19:52:55 -0000 Issue 6390

2009-10-14 Thread php-general-digest-help
php-general Digest 14 Oct 2009 19:52:55 - Issue 6390 Topics (messages 298887 through 298895): SimpleXML var_dump() weirdness 298887 by: Mattias Thorslund Re: Signing (hand-written signature) pdf document 29 by: Ashley Sheridan regex for multiple line breakes

Re: [PHP] Signing (hand-written signature) pdf document

2009-10-14 Thread Ashley Sheridan
On Tue, 2009-10-13 at 20:07 -0700, nashrul wrote: Hi... I'm thinking about a document management system that can put user signature on the created digital document. Here's the app-flow I can imagine ... My php application creates a pdf document. The pdf document is displayed to user. Using

[PHP] regex for multiple line breakes

2009-10-14 Thread Merlin Morgenstern
Hi there, I am trying to remove multiple linebreakes from a textarea input. Spammers tend to insert multiple line breakes. The problem is, that I want to allow 2 line breaks so basic formating should be allowed. I am doing this by regex: $data[txt] = preg_replace('`[\r\n]+`',\n,$data[txt]);

Re: [PHP] regex for multiple line breakes

2009-10-14 Thread Fernando Castillo Aparicio
You are replacing 1 or more matchs of a new line. To match 2 or more you can use {2,}. It's a range, first number means min matches, second max matches. Omitting last number means no max limit. $data[txt] = preg_replace('`[\r\n]{2,}`',\n,$data[txt]); De:

Re: [PHP] regex for multiple line breakes

2009-10-14 Thread Merlin Morgenstern
That sounds very logical but does not work unfortunatelly. The result is the same. It removes all linebreakes but one. I would like to pass this one: - first line second third - But not this one: - third forth Fernando Castillo Aparicio schrieb: You are

Re: [PHP] regex for multiple line breakes

2009-10-14 Thread Ashley Sheridan
On Wed, 2009-10-14 at 12:42 +0200, Merlin Morgenstern wrote: That sounds very logical but does not work unfortunatelly. The result is the same. It removes all linebreakes but one. I would like to pass this one: - first line second third - But not this one:

Re: [PHP] regex for multiple line breakes

2009-10-14 Thread Fernando Castillo Aparicio
Right. I saw it later. To be completely multiplatform I'd use a grouping: (\n|\r|\r\n){2,}. If I'm not wrong, these are all the actual formats for a new line. If we replace \r with a newline we could fail if the text comes from a MAC OS. De: Ashley Sheridan

Re: [PHP] regex for multiple line breakes

2009-10-14 Thread Merlin Morgenstern
Ashley Sheridan schrieb: On Wed, 2009-10-14 at 12:42 +0200, Merlin Morgenstern wrote: That sounds very logical but does not work unfortunatelly. The result is the same. It removes all linebreakes but one. I would like to pass this one: - first line second third - But not

Re: [PHP] Need unrounded precision

2009-10-14 Thread Philip Thompson
On Oct 12, 2009, at 2:37 PM, Andrea Giammarchi wrote: bitwise right shift is probably the fastest cast to int so far ... still in many languages, intval is a function call being a cast in both cases (int) is good as well ... bitwise, casting, works with strings, arrays, boolean, whatever

[PHP] php-ldap works in commandline but not through browser

2009-10-14 Thread chima s
Hi All, I am using tring with sample program to connect the ldap using php. Below is the sample code: == ?php echo $test=ldapAuthenticate('username','password','domainname'); function ldapAuthenticate($username,$password,