Re: [PHP] Split

2011-12-13 Thread Dajka Tamás
Hi, First, read the help of 'preg_replace' at php.net. Second: try this: preg_split('/\//',$sPath,$iMax) Third: use explode: explode('/',) Cheers, Tamas 2011.12.13. dátummal, 21:33 időpontban Jack írta: > OK so I have seen enough errors about split, so I decided to update my co

RE: [PHP] PHP Version: 5.2.5.

2011-10-17 Thread Dajka Tamás
Hi, PHP parser is not enabled ( module not enabled or not associated with .php/.html/.htm files! ) Cheers, Tamas -Original Message- From: Joseph Adenuga [mailto:jadenu...@yahoo.com] Sent: Monday, October 17, 2011 3:55 PM To: php-general@lists.php.net Cc: jadenu...@yahoo.com Sub

RE: [PHP] Newbie question. What is the best structure of a php-app?

2011-08-16 Thread Dajka Tamás
Hi, Surely there's a wiki/doc somewhere :) But for the start: 1) plan what exactly you want to accomplish ( functionality ) 2) complexity - if simple, just throw it in one php ( like index.php ) - if more complex, you can separate the pages and/or use classes 3) based on 2), plan

RE: [PHP] Problem with inserting numbers...

2011-08-11 Thread Dajka Tamás
While no tusing just one while loop? $num = 0; while ( ( $row = mysql_fetch_assoc($result) ) && $num++ <= 1000 ) { //do whatever you want and you'll get all results or max. 1000 lines ( whatever comes first ) } Cheers, Tom -Original Message- From: Tim Streater [mailto:t

RE: [PHP] Struggling with MySQL query

2011-08-09 Thread Dajka Tamás
Or the query should look like this, if there is a 'headline' field: UPPER(`headline`) LIKE '%".mysql_real_escape_string(trim(strtoupper($find)))."%' Cheers, Tamas -Original Message- From: Andrew Ballard [mailto:aball...@gmail.com] Sent: Tuesday, August 09, 2011 4:55 PM To: Davi

RE: RE: [PHP] Use of preg_replace

2011-07-24 Thread Dajka Tamás
;([>]+From )/','$1', $line) Cheers, Tamas -Original Message- From: Tim Streater [mailto:t...@clothears.org.uk] Sent: Sunday, July 24, 2011 8:51 PM To: Dajka Tamás; PHP General List Subject: Re: RE: [PHP] Use of preg_replace On 24 Jul 2011 at 19:35, Dajka Tamás

RE: [PHP] Use of preg_replace

2011-07-24 Thread Dajka Tamás
Hi, I lost trail, what do you want to do? You want to convert >>>From to this: >>From Or what's the goal? Cheers, Tamas -Original Message- From: Tim Streater [mailto:t...@clothears.org.uk] Sent: Sunday, July 24, 2011 8:07 PM To: PHP General List Subject: [PHP] Use of preg_

RE: [PHP] Foreach question

2011-07-06 Thread Dajka Tamás
.com] Sent: Tuesday, July 05, 2011 5:47 PM To: Robert Cummings Cc: Dajka Tamás; php-general@lists.php.net Subject: Re: [PHP] Foreach question Just use count($arr) in your for-header, as it get's executed again for each loop. 1), array('id'=>2))

RE: [PHP] Foreach question

2011-07-05 Thread Dajka Tamás
Thanks, that was interesting :) I think I got one step further in understanding PHP :) BTW, I've changed the loop to 'for' and it's working well :) -Original Message- From: Robert Cummings [mailto:rob...@interjinn.com] Sent: Tuesday, July 05, 2011 4:45 PM To:

RE: [PHP] Foreach question

2011-07-05 Thread Dajka Tamás
l always return true with two elements? ( since the first elements copy is pushed as third element, etc ) -Original Message- From: Robert Cummings [mailto:rob...@interjinn.com] Sent: Tuesday, July 05, 2011 4:28 PM To: Dajka Tamás Cc: php-general@lists.php.net Subject: Re: [PHP] Foreach q

RE: [PHP] Foreach question

2011-07-05 Thread Dajka Tamás
Tried, gives the same result with one element :( What's working: $cats = array( array( 'id' => 1 ) ); while ( $c = array_shift($cats) ) { echo $c['id']; if ( $c['id'] < 5 ) { $c['id']++; $cats[] = $c; } } But this is 'while' and it pops all

RE: [PHP] Foreach question

2011-07-05 Thread Dajka Tamás
Hi, Yeah, I'm really want to do that, since I'm working with the elements of the original array ( skipped that part in sample code ). I've tried your suggestion, but it gives the same result, so on just one input is just gives back '1'. What troubles me, that foreach gives an inconsistent work