[PHP] find duplicated values in array and count them

2004-11-11 Thread Patrick Fehr
Hi all I need to compare values of multiple arrays, the tricky thing: I can't just use array_diff, because I also need to count all the occurences and give them back. The more tricky thing: It's a foreach loop through $arr[x ['comparable value'] while x is 1,4,3,6... so it's not that easy to

[PHP] UPDATE: find duplicated values in array and count them

2004-11-11 Thread Patrick Fehr
Patrick Fehr wrote: Hi all I need to compare values of multiple arrays The obvious problem is, that I can't use array_count_values() because the values are in different arrays, and array_count_values() refuses to compare over different arrays :) greets to all patrick -- Patrick Fehr

[PHP] zip_open + PHP 5

2004-11-11 Thread Nick Halstead
I have just changed to PHP 5 as I wanted to extend the functionality of one of my projects to further use its OO. But I just discovered that one of the extensions available under PHP 4+ isnt included in the same way, The zip_open + other functions are not available under the configure options

[PHP] Looking for pointers to mysql functions

2004-11-11 Thread Stuart Felenstein
I'm building a search function and I think most of the search part is solid. Now I'm trying to figure out the results part. Since my results would return about 7 fields per record, I'm thinking mysql_fetch_row over mysql results works better ? But I don't want every field from the row returned,

[PHP] Re: __PHP_Incomplete_Class Errors...

2004-11-11 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Stephen Craton wrote: I've been working on a script for a while now and it works perfectly on my local machine. I'm using a couple of classes, mainly my database and users classes. After logging in, I assign a session variable to the user's row in the database: $_SESSION['user'] = $db-row;

Re: [PHP] zip_open + PHP 5

2004-11-11 Thread Klaus Reimer
Nick Halstead wrote: I have just changed to PHP 5 as I wanted to extend the functionality of one of my projects to further use its OO. But I just discovered that one of the extensions available under PHP 4+ isnt included in the same way, The zip_open + other functions are not available under the

[PHP] Php shell_exec_ timeout

2004-11-11 Thread user
HI, Does anybody know if its possible to execute a command through exec, shell exec, system and if the program doesn't terminate in N seconds returns control to PHP ? Thanks in advance Rui Francisco -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Looking for pointers to mysql functions

2004-11-11 Thread bbonkosk
This would be handled in your query, so get a SQL book or look into the mysql documentation... Look at the select statement, to request specific fields, as well as the Limit keyword to return a certain number of results per page. -B - Original Message - From: Stuart Felenstein [EMAIL

Re: [PHP] Looking for pointers to mysql functions

2004-11-11 Thread Stuart Felenstein
--- [EMAIL PROTECTED] wrote: This would be handled in your query, so get a SQL book or look into the mysql documentation... Look at the select statement, to request specific fields, as well as the Limit keyword to return a certain number of results per page. -B So there is no php

RE: [PHP] Looking for pointers to mysql functions

2004-11-11 Thread Graham Cossey
-Original Message- From: Stuart Felenstein [mailto:[EMAIL PROTECTED] Sent: 11 November 2004 11:32 To: [EMAIL PROTECTED] Subject: [PHP] Looking for pointers to mysql functions I'm building a search function and I think most of the search part is solid. Now I'm trying to

[PHP] Calling a C program from php

2004-11-11 Thread Rayan Lahoud
Hello, does anybody knows how to call a C function from a php code? Thank you!! :) - Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com

RE: [PHP] Looking for pointers to mysql functions

2004-11-11 Thread Stuart Felenstein
--- Graham Cossey [EMAIL PROTECTED] wrote: Is this something like what you are after: ?php $sql = SELECT col1, col2, col3, col4 as colx, col5 FROM my_table WHERE col2 LIKE '%$search%' ORDER BY col3 LIMIT $from, $max_results; $result =

Re: [PHP] Looking for pointers to mysql functions

2004-11-11 Thread bbonkosk
- Original Message - From: Stuart Felenstein [EMAIL PROTECTED] Date: Thursday, November 11, 2004 7:13 am Subject: Re: [PHP] Looking for pointers to mysql functions --- [EMAIL PROTECTED] wrote: This would be handled in your query, so get a SQL book or look into the mysql

Re: [PHP] Calling a C program from php

2004-11-11 Thread Chris Shiflett
--- Rayan Lahoud [EMAIL PROTECTED] wrote: does anybody knows how to call a C function from a php code? Try this: http://pear.php.net/package/Inline_C Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly HTTP Developer's Handbook - Sams Coming

Re: [PHP] Question on functions

2004-11-11 Thread Sebastian Mendel
Jason wrote: Looks like you understand already. Did you have some broken code you wanted help with? yeah.. I should have posted it first. Here it is: /* User Defined Variables */ $defined = array( 0 = localhost, 1 = user, 2 =

Re: [PHP] should basic data validation go outside a function or inside?

2004-11-11 Thread Sebastian Mendel
Brad Pauly wrote: should basic data validation come before a function call or be performed within the function? I would do the validation inside the function. This avoids repeating the validation everywhere the function is called. It also makes the function more self-contained. It expects a

[PHP] Re: LINUX: Problem with php installation

2004-11-11 Thread Sebastian Mendel
Abhilash Kumar wrote: I installed latest version of PHP from the source on a AMD ATHELON64 system with REDHAT 9.0 installed with apache server 2. There were no error upon running configure or make or make install I have checked the instalation procedures many times now but I get a blank screen on

Re: [PHP] Question on functions

2004-11-11 Thread Jason
Sorry, yeah it is a typo Sebastian Mendel wrote: Jason wrote: Looks like you understand already. Did you have some broken code you wanted help with? yeah.. I should have posted it first. Here it is: /* User Defined Variables */ $defined = array( 0 = localhost, 1

[PHP] Re: header variable ?

2004-11-11 Thread Sebastian Mendel
Jerry Swanson wrote: What variable header use? If I send something in header, what GLOBAL variable header use? do you mean $_SERVER ? $_SERVER holds some header-information sent by the client to the webserver -- Sebastian Mendel www.sebastianmendel.de www.warzonez.de www.tekkno4u.de

Re: [PHP] Question on functions

2004-11-11 Thread Sebastian Mendel
Jason wrote: Looks like you understand already. Did you have some broken code you wanted help with? yeah.. I should have posted it first. Here it is: /* User Defined Variables */ $defined = array( 0 = localhost, 1 = user, 2 =

[PHP] Shell_exec timeout question

2004-11-11 Thread Rui Francisco
HI, Does anybody know if its possible to execute a command through exec, shell exec, system and if the program doesn't terminate in N seconds returns control to PHP ? Thanks in advance Rui Francisco -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] Re: find duplicated values in array and count them

2004-11-11 Thread Sebastian Mendel
Patrick Fehr wrote: Hi all I need to compare values of multiple arrays, the tricky thing: I can't just use array_diff, because I also need to count all the occurences and give them back. The more tricky thing: It's a foreach loop through $arr[x ['comparable value'] while x is 1,4,3,6... so it's

Re: [PHP] Question on functions

2004-11-11 Thread Jason
Sebastian Mendel wrote: Jason wrote: Looks like you understand already. Did you have some broken code you wanted help with? yeah.. I should have posted it first. Here it is: /* User Defined Variables */ $defined = array( 0 = localhost, 1 = user,

[PHP] passing resources from one script to another

2004-11-11 Thread Ian Firla
Hi All, I'm developing a small server application that accepts connections on a socket and then launches an interactive session with the client. The server needs to be able to accept N connections. This part is working famously thanks to code I've borrowed and modified from:

[PHP] How do I su to another account??

2004-11-11 Thread Scott Fletcher
How do I su (switch user) to another account from the nobody in php? I haven't got it to work, so I get the impression that it is either I'm doing it all wrong in PHP script or that the nobody doesn't have the authority to do so. Have anyone who ever successfully do it please post a sample

[PHP] Re: How do I su to another account??

2004-11-11 Thread Jason
Well if you are using apache as your webserver you can use a module which supports this feature... mod_chroot, mod_ruid or mod_suid2 is what you want. Or just as a suggestion if you don't want to change the running environment of apache I recommend having your script set a flag (temp file or

Re: [PHP] passing resources from one script to another

2004-11-11 Thread Greg Donald
On Thu, 11 Nov 2004 15:15:56 +0100, Ian Firla [EMAIL PROTECTED] wrote: The problem is the dialogue with the client. If I enter into a while loop then the whole script remains occupied and cannot accept new connections. PHP doesn't have threads.. and that's what you would need to accept more

Re: [PHP] passing resources from one script to another

2004-11-11 Thread Ian Firla
I should have specified that this is a shell script, not a web application. I have a listening process running. The listening process calls another script once a connection is established. This is done via exec. It works; however, I can't pass a resource directly to the other script. Therefore,

Re: [PHP] passing resources from one script to another

2004-11-11 Thread Ian Firla
Thanks Greg. That is what I'm doing. The problem remains passing a resource to the script executed by exec. Ian On Thu, 2004-11-11 at 08:45 -0600, Greg Donald wrote: On Thu, 11 Nov 2004 15:15:56 +0100, Ian Firla [EMAIL PROTECTED] wrote: The problem is the dialogue with the client. If I

[PHP] Re: [PHP-I18N] How to get WIN-1255 encoded string

2004-11-11 Thread shimi
From what I've seen, if someone mails me a correctly formatted message, I get the title right, however something like a non-standard mail clients does it, I get the =windows-1255 string you gave as the subject. Do note: The standard name is ISO-8859-8-I. NOT windows-1255, which is a nice

Re: [PHP] Programmatic Browser Rendering Engine?

2004-11-11 Thread M Saleh EG
I've seen screenshots of websites using Live website rendered and shown in an IFRAME scaled down to say.. 50% . IFRAME is your keyword I guess. However, your idea is realy creative. On Wed, 10 Nov 2004 13:39:00 -0800 (PST), Richard Lynch [EMAIL PROTECTED] wrote: Please Cc: me, as it's been

Re: [PHP] Question on functions

2004-11-11 Thread elixon
I'm not certified expert ;-) but what I meant is Do not use function that writes to the hardcoded global variables: example: function db() { ... $GLOBALS['db']=x_open_something($GLOBALS['...'], ...); ... } This function is really... hm... not flexible enough ;-) It can make

[PHP] Evaluate String as Object

2004-11-11 Thread bubba
Hi, Is it possible to evaluate a string passed to a script as an object? If, for example, I have the following executing in my script: $result = $player_1-execute_query(); // OR $result = $player_2-execute_query(); If I pass a value to a script in the following manner, say: $playername =

Re: [PHP] Question on functions

2004-11-11 Thread Jason
That is exactly the type of example I was in need of. Thanks a ton. Elixon wrote: I'm not certified expert ;-) but what I meant is Do not use function that writes to the hardcoded global variables: example: function db() { ... $GLOBALS['db']=x_open_something($GLOBALS['...'], ...); ...

Re: [PHP] Arrays

2004-11-11 Thread James E Hicks III
Ben Miller wrote: edit I hope this is not a stupid question, but I am learning how to work with Arrays, and am having trouble figuring out how to move array values [the whole array and all of it's values] from page to page and/or store in a db. ? echo (htmlheadtitleArray

[PHP] mssql_fetch_array() vs. mssql_fetch_assoc

2004-11-11 Thread Alex Hogan
In terms of performance which is faster. mssql_fetch_array($var,mssql_assoc) or mssql_fetch_assoc()? I read in the manual that mssql_fetch_array() isn't noticably slower than mssql_fetch_row(), but I didn't see anything about mssql_fetch_assoc() in terms of performance. I was wondering if

Re: [PHP] mssql_fetch_array() vs. mssql_fetch_assoc

2004-11-11 Thread Gerard Samuel
Alex Hogan wrote: In terms of performance which is faster. mssql_fetch_array($var,mssql_assoc) or mssql_fetch_assoc()? I read in the manual that mssql_fetch_array() isn't noticably slower than mssql_fetch_row(), but I didn't see anything about mssql_fetch_assoc() in terms of performance. I was

[PHP] how come mysql_connect() doesn't work?

2004-11-11 Thread Robert Ozimek
how come mysql_connect() doesn't work? What should i use instead to get me connect MySql. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] how come mysql_connect() doesn't work?

2004-11-11 Thread Jay Blanchard
[snip] how come mysql_connect() doesn't work? What should i use instead to get me connect MySql. [/snip] Are you getting a specific error? Can you show us the code you are using? What version of PHP? Without this we cannot help you. -- PHP General Mailing List (http://www.php.net/) To

[PHP] inline_C installation

2004-11-11 Thread Rayan Lahoud
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? Thank you - Do you Yahoo!? Check out the new Yahoo! Front Page.

Re: [PHP] How do I su to another account??

2004-11-11 Thread Ian Firla
Do you really need to switch users or do you need to run something as another user? Try looking into setting up and using sudo. Ian On Thu, 2004-11-11 at 09:20 -0500, Scott Fletcher wrote: How do I su (switch user) to another account from the nobody in php? I haven't got it to work, so I

Re: [PHP] calling function from function?

2004-11-11 Thread Greg Donald
On Thu, 11 Nov 2004 12:26:17 -0700, Jason [EMAIL PROTECTED] wrote: function db( $host, $user, $pass, $dbnam ) { $db = @mysql_pconnect( $host, $user, $pass )or die( mysql_error( $db )); @mysql_select_db( $dbnam )or die( mysql_error( $db ) ); return $db; } function logs() { If

Re: [PHP] calling function from function?

2004-11-11 Thread Rick Fletcher
db( $defined[0], $defined[1], $defined[2], $defined[3] ); which tells me that the $db handle is not being returned when called from the db() function from within the logs() function and I am not sure why? it's being returned, you've just forgotten to assign it. add a $db = to the beginning

Re: [PHP] calling function from function?

2004-11-11 Thread Jason
Rick Fletcher wrote: function db( $host, $user, $pass, $dbnam ) { $db = @mysql_pconnect( $host, $user, $pass )or die( mysql_error( $db )); @mysql_select_db( $dbnam )or die( mysql_error( $db ) ); return $db; } function logs() { global $defined; db( $defined[9], $defined[1], $defined[2],

Re: [PHP] calling function from function?

2004-11-11 Thread Curt Zirzow
* Thus wrote Jason: function db( $host, $user, $pass, $dbnam ) { $db = @mysql_pconnect( $host, $user, $pass )or die( mysql_error( $db )); @mysql_select_db( $dbnam )or die( mysql_error( $db ) ); return $db; } function logs() { global $defined; db( $defined[9], $defined[1],

Re: [PHP] Url encoding awry

2004-11-11 Thread Rick Fletcher
I have a dynamically created image labeled: stories critiques.jpg I have use url encode on it when saving it, and it is stored on the server as: stories+%26+crtitiques.jpg [snip] If I just put the path into the browser directly it also 404's If I rename the file in any way that removes the % it

Re: [PHP] calling function from function?

2004-11-11 Thread Jason
I hate posting all of that code, but for Greg's question... it does give me the correct array data. Jason wrote: Rick Fletcher wrote: function db( $host, $user, $pass, $dbnam ) { $db = @mysql_pconnect( $host, $user, $pass )or die( mysql_error( $db )); @mysql_select_db( $dbnam )or die(

Re: [PHP] calling function from function?

2004-11-11 Thread Greg Donald
On Thu, 11 Nov 2004 12:42:44 -0700, Jason [EMAIL PROTECTED] wrote: There isnt an error at all. How could there be an error? You're using @ to suppress nearly every mysql function call. Makes it kind of hard to debug that way. -- Greg Donald Zend Certified Engineer http://gdconsultants.com/

[PHP] Which PHP for MySQL 4.1

2004-11-11 Thread C.F. Scheidecker Antunes
Hello, I would like to migrate my MySQL servers from 4.0 to 4.1. As I use PHP as well as Java with these servers I wonder what PHP 4 version would be compatible with MySQL 4.1. Has anyone used MySQL 4.1 with PHP yet? I appreciate your thoughts. Thanks. -- PHP General Mailing List

[PHP] Url encoding awry

2004-11-11 Thread ydragon
Hello all I have a dynamically created image labeled: stories critiques.jpg I have use url encode on it when saving it, and it is stored on the server as: stories+%26+crtitiques.jpg I have an html block that calls the image img src=stories+%26+crtitiques.jpg I get a 404 I know the path

Re: [PHP] calling function from function?

2004-11-11 Thread Jason
Greg Donald wrote: On Thu, 11 Nov 2004 12:42:44 -0700, Jason [EMAIL PROTECTED] wrote: There isnt an error at all. How could there be an error? You're using @ to suppress nearly every mysql function call. Makes it kind of hard to debug that way. yep, you are right... I removed the @ for each of

Re: [PHP] calling function from function?

2004-11-11 Thread Jason
Rick Fletcher wrote: db( $defined[0], $defined[1], $defined[2], $defined[3] ); which tells me that the $db handle is not being returned when called from the db() function from within the logs() function and I am not sure why? it's being returned, you've just forgotten to assign it. add a

[PHP] calling function from function?

2004-11-11 Thread Jason
function db( $host, $user, $pass, $dbnam ) { $db = @mysql_pconnect( $host, $user, $pass )or die( mysql_error( $db )); @mysql_select_db( $dbnam )or die( mysql_error( $db ) ); return $db; } function logs() { global $defined; db( $defined[9], $defined[1], $defined[2], $defined[3] ); ...

RE: [PHP] Which PHP for MySQL 4.1

2004-11-11 Thread Jay Blanchard
[snip] I would like to migrate my MySQL servers from 4.0 to 4.1. As I use PHP as well as Java with these servers I wonder what PHP 4 version would be compatible with MySQL 4.1. Has anyone used MySQL 4.1 with PHP yet? [/snip] PHP 4 is compatible with MySQL 4.1. My caution to you would be using

Re: [PHP] calling function from function?

2004-11-11 Thread Rick Fletcher
function db( $host, $user, $pass, $dbnam ) { $db = @mysql_pconnect( $host, $user, $pass )or die( mysql_error( $db )); @mysql_select_db( $dbnam )or die( mysql_error( $db ) ); return $db; } function logs() { global $defined; db( $defined[9], $defined[1], $defined[2], $defined[3] ); ...

Re: [PHP] Calling a C program from php

2004-11-11 Thread Thomas Goyne
On Thu, 11 Nov 2004 02:51:54 -0800 (PST), Rayan Lahoud [EMAIL PROTECTED] wrote: Hello, does anybody knows how to call a C function from a php code? Thank you!! :) http://us4.php.net/manual/en/function.system.php -- Using M2, Opera's revolutionary e-mail client:

Re: [PHP] Which PHP for MySQL 4.1

2004-11-11 Thread Brent Baisley
I migrated to MySQL 4.1 about a month ago. I had some issues with PHP (running 4.3.6) communicating with MySQL because 4.1 implements a new form of communication. As I recall, I had to do something with the passwords in the grants table, but I forget what now. It's been working fine since. On

Re: [PHP] how come mysql_connect() doesn't work?

2004-11-11 Thread Jonathan Charette
I think I know, You're probably using php 5. mysql module is not 'installed' in it.. Jay Blanchard [EMAIL PROTECTED] a écrit dans le message de news: [EMAIL PROTECTED] [snip] how come mysql_connect() doesn't work? What should i use instead to get me connect MySql. [/snip] Are you getting a

Re: [PHP] Which PHP for MySQL 4.1

2004-11-11 Thread Jim Wharton
You will need to use the old_password() function in MySQL 4.1 and above. You can find out more at mysql.com Jim On Thu, 2004-11-11 at 15:58 -0500, Brent Baisley wrote: I migrated to MySQL 4.1 about a month ago. I had some issues with PHP (running 4.3.6) communicating with MySQL because 4.1

[PHP] Re: How do I su to another account??

2004-11-11 Thread Scott Fletcher
Um, I'll look into it. Thanks... Scott Jason [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Well if you are using apache as your webserver you can use a module which supports this feature... mod_chroot, mod_ruid or mod_suid2 is what you want. Or just as a suggestion if you don't

Re: [PHP] How do I su to another account??

2004-11-11 Thread Scott Fletcher
Yea, switch users so I can do the chmod, chown, etc... Um, I'll look into it. Thanks, Scott Ian Firla [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Do you really need to switch users or do you need to run something as another user? Try looking into setting up and using sudo.

Re: [PHP] Which PHP for MySQL 4.1

2004-11-11 Thread Chris
The MySQL library for 4.1.x is mysqli_* ( http://www.php.net/mysqli ) , that's only works with PHP 5 as far as I know. The old MySQL library ( http://www.php.net/mysql ) Can be used with PHP 4 (any version), but it won't be able to connect to MySQL with a user using the new password system

Re: [PHP] inline_C installation

2004-11-11 Thread Ryan King
On Nov 11, 2004, at 12:50 PM, 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? I believe the inline_c package is actually a pecl package [pecl.php.net],

Re: [PHP] Which PHP for MySQL 4.1

2004-11-11 Thread Chris
In my previous email OLDPASSWORD() should have been OLD_PASSWORD() Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Problems when 'nc ' entered into a field on a form

2004-11-11 Thread Jason Oakley
I have this strange problem. If anyone enteres the letters 'nc ' that is N C and a space (eg typing Bobs Inc or Hotsync etc) the server gives: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Now I suppose it could be

[PHP] how to parse a string parse with ereg

2004-11-11 Thread Mark-Walter
Hi, I've a string where the output of route -n is in for example. x.x.x.x 0.0.0.0 255.255.255.255 UH0 00 ppp0 192.168.0.0 0.0.0.0 255.255.255.0 U 0 00 eth1 0.0.0.0 x.x.x.x 0.0.0.0 UG0 00 ppp0 The

[PHP] Session file not written, session variables messed up.

2004-11-11 Thread Rodolfo
Hi, I have a weird problem with sessions on PHP 4.3.9 + Apache 1.3.33 in Slackware, maybe someone could help me or have had the same problem. I'm getting these messages in my logs: PHP Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of

Re: [PHP] Problems when 'nc ' entered into a field on a form

2004-11-11 Thread John Holmes
Jason Oakley wrote: I have this strange problem. If anyone enteres the letters 'nc ' that is N C and a space (eg typing Bobs Inc or Hotsync etc) the server gives: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Now I

[PHP] PHP and eCommerce?

2004-11-11 Thread Jason Bourque
Hello, Are there any free shopping carts out there that can handle the credit card transaction? How do I get started here? Any help is greatly appreciated. Thanks, Jason Bourque -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP and eCommerce?

2004-11-11 Thread Afan Pasalic
99% of shopping carts are able to handlel credit card transactions. search php shopping cart on google freshmeat.net hotscripts.com I use most of the time osCommerce. More then happy. Used several times X-Cart. They are good too, but not for free. -afan Jason Bourque wrote: Hello, Are there any

Re: [PHP] how to parse a string parse with ereg

2004-11-11 Thread Jason Wong
On Friday 12 November 2004 00:50, [EMAIL PROTECTED] wrote: The regular expression is already working but how can I reduce the string to have then only 2 lines ? Convert the string into an array using explode(). -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software

RE: [PHP] keeping format of text in textbox

2004-11-11 Thread Justin.Baiocchi
I use this when submitting the data from the form (for jokes): if ($submit) { $joke = nl2br($joke); $dbcnx = @mysql_connect( localhost, root, password); mysql_select_db(movements); $sql = INSERT INTO jokes SET author='$author', joke='$joke', id='$id'; mysql_query($sql); echo bThank you, your

Re: [PHP] adding a space every 4 chars

2004-11-11 Thread Jason Wong
On Friday 12 November 2004 04:49, Justin French wrote: What's the quickest way to add a space every four characters? Eg 123456789 becomes 1234 5678 9 No idea whether it's the quickest (in terms of cpu time): $doo = '123456789'; $dah = preg_replace('/(\d{4})/', '\\1 ', $doo); echo

[PHP] adding a space every 4 chars

2004-11-11 Thread Justin French
Hi, What's the quickest way to add a space every four characters? Eg 123456789 becomes 1234 5678 9 TIA, Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] adding a space every 4 chars

2004-11-11 Thread Justin French
On 13/11/2004, at 12:20 AM, Jason Wong wrote: No idea whether it's the quickest (in terms of cpu time): $doo = '123456789'; $dah = preg_replace('/(\d{4})/', '\\1 ', $doo); echo $dah; Quickest for me is more about lines of code and simplicity, so, thanks!! Justin -- PHP General Mailing

Re: [PHP] keeping format of text in textbox

2004-11-11 Thread Justin French
On 12/11/2004, at 4:05 PM, Amanda Hemmerich wrote: I did a search for this in the archive but didn't find anything. Is there a way to preserve the format of text in a textbox that is being saved in a database and then pulled out and displayed? The people entering the data want to keep their tabs

[PHP] Re: adding a space every 4 chars

2004-11-11 Thread Greg Beaver
Justin French wrote: Hi, What's the quickest way to add a space every four characters? Eg 123456789 becomes 1234 5678 9 ?php $a = '123456789'; echo implode(' ', str_split($a, 4)); ? Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] keeping format of text in textbox

2004-11-11 Thread Amanda Hemmerich
I did a search for this in the archive but didn't find anything. Is there a way to preserve the format of text in a textbox that is being saved in a database and then pulled out and displayed? The people entering the data want to keep their tabs and newlines, but right now, that's not happening.

RE: [PHP] keeping format of text in textbox

2004-11-11 Thread David Robley
On Fri, 12 Nov 2004 15:41, Justin Baiocchi wrote: I use this when submitting the data from the form (for jokes): if ($submit) { $joke = nl2br($joke); $dbcnx = @mysql_connect( localhost, root, password); mysql_select_db(movements); $sql = INSERT INTO jokes SET author='$author',

[PHP] Question for the PHP consultants out there.

2004-11-11 Thread Brent Clements
What web based software project management tool do you use to keep track of projects, project tasks, customer requests, and bug reports? I need something that would allow a customer to keep track of his/her project basically and to use the application to submit bug requests, feature requests,

Re: [PHP] Question for the PHP consultants out there.

2004-11-11 Thread Jason Wong
On Friday 12 November 2004 06:36, Brent Clements wrote: I'm looking at replacing a home-grown solution I wrote in PHP a while back. I've done the google thing, but everything I've tried doesn't really sit well with me. So...now I'm turning to my peers for suggestions. List what you tried.

[PHP] parsing /'s in urls

2004-11-11 Thread leehro
My host recently upgraded PHP. I had a script, download.php, that would work like this http://www.myhost.com/download.php/30/file.torrent the download.php script would take the 30, look up the real filename in the database, and readfile() it back. this was a great setup because the browser

[PHP] Simple XML

2004-11-11 Thread Octavian Rasnita
Hi all, Does anyone know if PHP has a library for getting the content of an XML file like XML::Simple in perl? In that perl library I can get the whole content of an XML file in a reference to an array of arrays of arrays... with only 3 lines of code. Is there such a simple method in PHP?