Re: [PHP] Choose Your Common Design Patterns

2008-02-28 Thread Zoltán Németh
2008. 02. 28, csütörtök keltezéssel 11.16-kor skylark ezt írta: > Hi guys, > > Relex a little on the topic "What design patterns do you usually use". > Choose the ones you use often at: http:// phparch [dot] cn > And this will answer that question, isn't it? you should've made the poll with the p

Re: [PHP] What design patterns do you usually use?

2008-02-28 Thread Zoltán Németh
2008. 02. 28, csütörtök keltezéssel 09.12-kor tedd ezt írta: > At 8:57 AM +0100 2/28/08, Zoltán Németh wrote: > >2008. 02. 27, szerda keltezéssel 14.02-kor tedd ezt írta: > > > Just about all my code was reduced to functions > >> and all functions were placed in files according > >> theme. My "m

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Nathan Nobbe
wow, im going to have to stare at some of those and play around with them as soon as im half awake :) of course i still like my solution ;) but im excited about the experimentation and ideas that have been shared on this topic, very interesting really! -nathan

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Robert Cummings
On Fri, 2008-02-29 at 05:34 +, Nathan Rixham wrote: > Casey wrote: > > > > I don't know why I'm continuing this... but for the truly crazy: > > function w(&$t) { > > $t = array('f' => '...'); > > return 't'; > > } > > > > echo ${w($t)}['f']; > > > >

Re: [PHP] handling dates before 1901

2008-02-28 Thread Larry Garfield
I don't know why it would have been working before and now stopped, but take a look at the DateTime class in PHP 5.2. It is designed to use 64-bit dates internally so it should handle a larger date range than humans have existed for. It has both OOP and procedural routines, depending on your p

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Nathan Rixham
Casey wrote: I don't know why I'm continuing this... but for the truly crazy: function w(&$t) { $t = array('f' => '...'); return 't'; } echo ${w($t)}['f']; addictive isn't it! casey, I truelly believe that's as short as it can

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Casey
On Thu, Feb 28, 2008 at 8:42 PM, Casey <[EMAIL PROTECTED]> wrote: > > On Thu, Feb 28, 2008 at 8:38 PM, Nathan Rixham <[EMAIL PROTECTED]> wrote: > > > > Robert Cummings wrote: > > > On Thu, 2008-02-28 at 23:27 -0500, Robert Cummings wrote: > > >> On Fri, 2008-02-29 at 04:04 +, Nathan Rixha

Re: [PHP] Making sure an include file works

2008-02-28 Thread Robert Cummings
On Thu, 2008-02-28 at 20:53 -0800, Jim Lucas wrote: > Robert Cummings wrote: > > On Thu, 2008-02-28 at 20:46 -0800, Jim Lucas wrote: > >> Robert Cummings wrote: > >>> On Thu, 2008-02-28 at 20:17 -0800, Casey wrote: > On Thu, Feb 28, 2008 at 7:50 PM, Robert Cummings <[EMAIL PROTECTED]> >

Re: [PHP] Making sure an include file works

2008-02-28 Thread Jim Lucas
Robert Cummings wrote: On Thu, 2008-02-28 at 20:46 -0800, Jim Lucas wrote: Robert Cummings wrote: On Thu, 2008-02-28 at 20:17 -0800, Casey wrote: On Thu, Feb 28, 2008 at 7:50 PM, Robert Cummings <[EMAIL PROTECTED]> wrote: On Thu, 2008-02-28 at 18:58 -0800, Richard S. Crawford wrote: > I'm t

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Robert Cummings
On Thu, 2008-02-28 at 20:42 -0800, Casey wrote: > On Thu, Feb 28, 2008 at 8:38 PM, Nathan Rixham <[EMAIL PROTECTED]> wrote: > > > > Robert Cummings wrote: > > > On Thu, 2008-02-28 at 23:27 -0500, Robert Cummings wrote: > > >> On Fri, 2008-02-29 at 04:04 +, Nathan Rixham wrote: > > >>> Rober

Re: [PHP] Making sure an include file works

2008-02-28 Thread Robert Cummings
On Thu, 2008-02-28 at 20:46 -0800, Jim Lucas wrote: > Robert Cummings wrote: > > On Thu, 2008-02-28 at 20:17 -0800, Casey wrote: > >> On Thu, Feb 28, 2008 at 7:50 PM, Robert Cummings <[EMAIL PROTECTED]> wrote: > >>> On Thu, 2008-02-28 at 18:58 -0800, Richard S. Crawford wrote: > >>> > I'm trying

Re: [PHP] Making sure an include file works

2008-02-28 Thread Jim Lucas
Robert Cummings wrote: On Thu, 2008-02-28 at 20:17 -0800, Casey wrote: On Thu, Feb 28, 2008 at 7:50 PM, Robert Cummings <[EMAIL PROTECTED]> wrote: On Thu, 2008-02-28 at 18:58 -0800, Richard S. Crawford wrote: > I'm trying to figure out a way to make sure an included PHP file has no syntax >

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Casey
On Thu, Feb 28, 2008 at 8:38 PM, Nathan Rixham <[EMAIL PROTECTED]> wrote: > > Robert Cummings wrote: > > On Thu, 2008-02-28 at 23:27 -0500, Robert Cummings wrote: > >> On Fri, 2008-02-29 at 04:04 +, Nathan Rixham wrote: > >>> Robert Cummings wrote: > On Fri, 2008-02-29 at 00:18 +,

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Robert Cummings
On Fri, 2008-02-29 at 04:38 +, Nathan Rixham wrote: > Robert Cummings wrote: > > On Thu, 2008-02-28 at 23:27 -0500, Robert Cummings wrote: > >> On Fri, 2008-02-29 at 04:04 +, Nathan Rixham wrote: > >>> Robert Cummings wrote: > On Fri, 2008-02-29 at 00:18 +, Nathan Rixham wrote: > >

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Nathan Rixham
Robert Cummings wrote: On Thu, 2008-02-28 at 23:27 -0500, Robert Cummings wrote: On Fri, 2008-02-29 at 04:04 +, Nathan Rixham wrote: Robert Cummings wrote: On Fri, 2008-02-29 at 00:18 +, Nathan Rixham wrote: don't say I didn't warn ya fellow nathan! #!/usr/bin/php 1, 'b' => 2, 'c' =

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Robert Cummings
On Thu, 2008-02-28 at 23:27 -0500, Robert Cummings wrote: > On Fri, 2008-02-29 at 04:04 +, Nathan Rixham wrote: > > Robert Cummings wrote: > > > On Fri, 2008-02-29 at 00:18 +, Nathan Rixham wrote: > > >> don't say I didn't warn ya fellow nathan! > > >> > > >> #!/usr/bin/php > > >> > >> fu

RE: [PHP] dont print echo

2008-02-28 Thread Mr Webber
Your script is screwed at the point where you do not close the quote: $folder = 'pictures; -Original Message- From: Emiliano Boragina [mailto:[EMAIL PROTECTED] Sent: Thursday, February 28, 2008 11:09 PM To: php-general@lists.php.net Subject: [PHP] dont print echo Hi list… All this in

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Robert Cummings
On Fri, 2008-02-29 at 04:04 +, Nathan Rixham wrote: > Robert Cummings wrote: > > On Fri, 2008-02-29 at 00:18 +, Nathan Rixham wrote: > >> don't say I didn't warn ya fellow nathan! > >> > >> #!/usr/bin/php > >> >> function sillyFunc() { > >>return array('a' => 1, 'b' => 2, 'c' => 3, 'd

Re: [PHP] Making sure an include file works

2008-02-28 Thread Robert Cummings
On Thu, 2008-02-28 at 20:17 -0800, Casey wrote: > On Thu, Feb 28, 2008 at 7:50 PM, Robert Cummings <[EMAIL PROTECTED]> wrote: > > > > On Thu, 2008-02-28 at 18:58 -0800, Richard S. Crawford wrote: > > > I'm trying to figure out a way to make sure an included PHP file has no > > syntax > > > err

Re: [PHP] reverse string without strrev();

2008-02-28 Thread Casey
On Thu, Feb 28, 2008 at 3:25 AM, Shelley <[EMAIL PROTECTED]> wrote: > Hi all, > > What do you think is the best way to display string 'abcdef' as 'fedcba'? > > Any ideas appreciated. > > Thanks in advance. > > > -- > Regards, > Shelley > ...What is wrong with strrev()? Am I missing something

Re: [PHP] Making sure an include file works

2008-02-28 Thread Casey
On Thu, Feb 28, 2008 at 7:50 PM, Robert Cummings <[EMAIL PROTECTED]> wrote: > > On Thu, 2008-02-28 at 18:58 -0800, Richard S. Crawford wrote: > > I'm trying to figure out a way to make sure an included PHP file has no > syntax > > errors before actually including it as a part of project. Is thi

Re: [PHP] Text Color

2008-02-28 Thread Jim Lucas
Jeff wrote: Please, can anyone tell me how to produce colored text? For instance if I wanted to following code to be printed as red text what would I need to add to they code? Thanks in advance. echo "".$myrow["char_name"]."".$myrow["char_level"]."".$class["class"]."".$myrow["kara"]."".$myrow

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Nathan Rixham
Robert Cummings wrote: On Fri, 2008-02-29 at 00:18 +, Nathan Rixham wrote: don't say I didn't warn ya fellow nathan! #!/usr/bin/php 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e'=>'some string'); } echo !${~${''}='sillyFunc'}=&${''}().${~${''}}['e'] . PHP_EOL; I was ready to use this system eve

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Nathan Rixham
Robert Cummings wrote: On Fri, 2008-02-29 at 00:18 +, Nathan Rixham wrote: don't say I didn't warn ya fellow nathan! #!/usr/bin/php 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e'=>'some string'); } echo !${~${''}='sillyFunc'}=&${''}().${~${''}}['e'] . PHP_EOL; I was ready to use this system eve

[PHP] Text Color

2008-02-28 Thread Jeff
Please, can anyone tell me how to produce colored text? For instance if I wanted to following code to be printed as red text what would I need to add to they code? Thanks in advance. echo "".$myrow["char_name"]."".$myrow["char_level"]."".$class["class"]."".$myrow["kara"]."".$myrow["karateam"]."

Re: [PHP] output buffering in CLI script.

2008-02-28 Thread Jim Lucas
Casey wrote: On Thu, Feb 28, 2008 at 3:39 AM, Jochem Maas <[EMAIL PROTECTED]> wrote: hi there, I can't seem to manage to buffer output (of an included file) in a CLI script, the following does not work: // buffer output so we can avoid the shebang line being output (an

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Robert Cummings
On Fri, 2008-02-29 at 00:18 +, Nathan Rixham wrote: > > don't say I didn't warn ya fellow nathan! > > #!/usr/bin/php > function sillyFunc() { > return array('a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e'=>'some > string'); > } > > echo !${~${''}='sillyFunc'}=&${''}().${~${''}}['e'] . PHP

Re: [PHP] output buffering in CLI script.

2008-02-28 Thread Casey
On Thu, Feb 28, 2008 at 3:39 AM, Jochem Maas <[EMAIL PROTECTED]> wrote: > hi there, > > I can't seem to manage to buffer output (of an included file) in a CLI > script, > the following does not work: > > > // buffer output so we can avoid the shebang line being > output (an

Re: [PHP] Making sure an include file works

2008-02-28 Thread Robert Cummings
On Thu, 2008-02-28 at 18:58 -0800, Richard S. Crawford wrote: > I'm trying to figure out a way to make sure an included PHP file has no > syntax > errors before actually including it as a part of project. Is this even > possible? I'm running into brick walls. I don't believe there is a functi

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Robert Cummings
On Thu, 2008-02-28 at 23:52 +, Nathan Rixham wrote: > Robert Cummings wrote: > > On Thu, 2008-02-28 at 20:43 +, Nathan Rixham wrote: > >> [snip] > >> Eric Butera wrote: > >>> I can hit tab and shift/tab too and it puts in spaces for me. > >> [snip] > >> Robert Cummings wrote: > >> > Uhhhm

Re: [PHP] dont print echo

2008-02-28 Thread chetan rane
> > I think that will solve your problem > > if(isset($_POST['submit'])){ > $folder = 'pictures; > > $load = copy($_FILES['file']['tmp_name'] , $folder . '/' . $_FILES > ['file']['name']); > > if ( $load ) { > > echo "Picture upload!"; > > } else {

Re: [PHP] Making sure an include file works

2008-02-28 Thread Dan Joseph
On Thu, Feb 28, 2008 at 9:58 PM, Richard S. Crawford < [EMAIL PROTECTED]> wrote: > I'm trying to figure out a way to make sure an included PHP file has no > syntax > errors before actually including it as a part of project. Is this even > possible? I'm running into brick walls. > > The include i

[PHP] dont print echo

2008-02-28 Thread Emiliano Boragina
Hi list… All this in the same php: When I try the php the echo "no picture =("; is there. How can I do to don’t appears the message before I upload de picture. Thanks. + _

RE: [PHP] Re: handling dates before 1901

2008-02-28 Thread Gabriel Kuri
old box - Ubuntu 6.06LTS (Dapper Drake) 64-bit new box - Gentoo Linux 64-bit - Gabriel Kuri | Sr. Network Engineer Instructional and Information Technology Division California State Polytechnic University, Pomona http://www.csupomona.edu/~iit | +1 909 979 6363 > -Original Message--

[PHP] Making sure an include file works

2008-02-28 Thread Richard S. Crawford
I'm trying to figure out a way to make sure an included PHP file has no syntax errors before actually including it as a part of project. Is this even possible? I'm running into brick walls. -- Slainte, Richard S. Crawford Editor-in-chief, Daikaijuzine (http://www.daikaijuzine.com) Personal web

[PHP] Re: handling dates before 1901

2008-02-28 Thread Nathan Rixham
Gabriel Kuri wrote: I recently migrated some php scripts from a box running php 4.4.4 to php 5.2.5. due to the nature of the data, some of the php scripts require handling dates before 1901. both boxes are 64-bit (original and new), however the new box isn't handling dates properly before 1901 wi

Re: [PHP] Re: imagettftext and utf-8 (swedish characters)

2008-02-28 Thread David Sveningsson
Nathan Rixham skrev: before going any further, your HTML page is in UTF-8 yes? with the appropriate content-type line. Yes, apache uses only utf-8 as charset and the html content-type meta tag is set to utf-8 too. Also, the html form validates at validator.w3.org plus: first debugging step

[PHP] handling dates before 1901

2008-02-28 Thread Gabriel Kuri
I recently migrated some php scripts from a box running php 4.4.4 to php 5.2.5. due to the nature of the data, some of the php scripts require handling dates before 1901. both boxes are 64-bit (original and new), however the new box isn't handling dates properly before 1901 with either the mktime()

[PHP] Re: imagettftext and utf-8 (swedish characters)

2008-02-28 Thread Nathan Rixham
Nathan Rixham wrote: David Sveningsson wrote: Hi, I've ran into some problems when outputing text to an image using imagettftext. I cannot get swedish characters to work, I just get a square. I've tried different fonts which I know has those characters (bitstream vera, arial, times new roman,

Re: [PHP] Re: imagettftext and utf-8 (swedish characters)

2008-02-28 Thread David Sveningsson
Nathan Rixham skrev: try changing: imagettftext( $im, $title_size, 0, 50, 50, $white, $font, $title ); to: imagettftext($im, $title_size, 0, 50, 50, $white, $font, utf8_decode($title)); It draws lesser squares, but no characters (except for the regular alphanum characters which is rendered

[PHP] Re: imagettftext and utf-8 (swedish characters)

2008-02-28 Thread Nathan Rixham
David Sveningsson wrote: Hi, I've ran into some problems when outputing text to an image using imagettftext. I cannot get swedish characters to work, I just get a square. I've tried different fonts which I know has those characters (bitstream vera, arial, times new roman, etc). What am I doing

[PHP] imagettftext and utf-8 (swedish characters)

2008-02-28 Thread David Sveningsson
Hi, I've ran into some problems when outputing text to an image using imagettftext. I cannot get swedish characters to work, I just get a square. I've tried different fonts which I know has those characters (bitstream vera, arial, times new roman, etc). What am I doing wrong? I know I must pas

RE: [PHP] Sessions

2008-02-28 Thread Warren Vail
Actually garbage cleanup can be controlled by writing your session handler functions. You can almost guarantee that noone else will step on your session (with the possible session of the user who hopes to benefit from this, by using a unique session id name, its in the manual under something like

Re: [PHP] Sessions

2008-02-28 Thread Ray Hauge
VamVan wrote: Hello People, I wanted to have your assistance in deciding few things here, basically I want to auto populate a registration form for people visiting second time or so on. I have already started a session,I know that session is a cookie so is it better to rely upon the session coo

[PHP] Sessions

2008-02-28 Thread VamVan
Hello People, I wanted to have your assistance in deciding few things here, basically I want to auto populate a registration form for people visiting second time or so on. I have already started a session,I know that session is a cookie so is it better to rely upon the session cookie for auto pop

Re: [PHP] Choose Your Common Design Patterns

2008-02-28 Thread Shelley
Wolf wrote: skylark wrote: Hi guys, Relex a little on the topic "What design patterns do you usually use". Choose the ones you use often at: http:// phparch [dot] cn And this will answer that question, isn't it? Those options are the ones that we often use. If there is any option needed to b

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Nathan Rixham
Nathan Nobbe wrote: On Thu, Feb 28, 2008 at 6:14 PM, Nathan Rixham <[EMAIL PROTECTED]> wrote: if I show you guys how to do this: echo sillyFunc()['a'] . PHP_EOL; using a few brackets and things do you promise not to laugh? *it's a bit weird* id like to see it. -nathan don't say I didn'

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Nathan Nobbe
On Thu, Feb 28, 2008 at 6:14 PM, Nathan Rixham <[EMAIL PROTECTED]> wrote: > if I show you guys how to do this: > > echo sillyFunc()['a'] . PHP_EOL; > > using a few brackets and things do you promise not to laugh? > *it's a bit weird* id like to see it. -nathan

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Nathan Nobbe
On Thu, Feb 28, 2008 at 4:22 PM, Jim Lucas <[EMAIL PROTECTED]> wrote: > So, I guess my question would be, why not take it one level deeper. > > include('ArrayClass.php'); > > function sillyFunc() { > return ArrayClass::create(array('a' => 1, 'b' => 2, 'c' => 3, 'd' => > 4)); > } > > echo sil

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Nathan Rixham
Robert Cummings wrote: On Thu, 2008-02-28 at 20:43 +, Nathan Rixham wrote: [snip] Eric Butera wrote: I can hit tab and shift/tab too and it puts in spaces for me. [snip] Robert Cummings wrote: > Uhhhm, I hit the tab button also and it does the right thing (namely > inserts 4 spaces). Als

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Nathan Rixham
Nathan Nobbe wrote: On Thu, Feb 28, 2008 at 2:36 PM, Ray Hauge <[EMAIL PROTECTED]> wrote: That's pretty cool. I wasn't sure if it would work with numerically indexed arrays, so I tried: // sillyFunc returns array(0=>1, 1=>2); ArrayClass::create(sillyFunc())->{"0"} I just tested it, and that

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Wolf
Except that if I inherit your code and I find it easier if it's indented to 8 spaces you've taken that choice away from me. Tabs are configurable on nearly all editors that exist in the world. If yours doesn't let you change the tab width, get a new one. But if you don't care about people who m

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Jim Lucas
Nathan Nobbe wrote: all, as we have discussed previously, php does not have support for retrieving array values on the same line in which they are returned. i have created a simple workaround, and would like to share. first there is the class (w/ other features omitted for the post) theArray =

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread TG
Ah.. yeah, since I almost always use spaces, I wouldn't have run into the different sized tab issue. Very odd. Thanks for the heads up on the possible weirdness. -TG - Original Message - From: "Eric Butera" <[EMAIL PROTECTED]> To: TG <[EMAIL PROTECTED]> Cc: php-general@lists.php.net

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Robert Cummings
On Thu, 2008-02-28 at 20:43 +, Nathan Rixham wrote: > [snip] > Eric Butera wrote: > > I can hit tab and shift/tab too and it puts in spaces for me. > [snip] > Robert Cummings wrote: > > Uhhhm, I hit the tab button also and it does the right thing (namely > > inserts 4 spaces). Also, when I h

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Eric Butera
On Thu, Feb 28, 2008 at 3:57 PM, TG <[EMAIL PROTECTED]> wrote: > > Should always use a monospace font in editors, so you should never have a > problem with font size differences. A space is as wide as an "I", etc. > > I don't remember what the default was, but my main editor is set for "Courier

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Greg Donald
On 2/28/08, Nathan Rixham <[EMAIL PROTECTED]> wrote: > what ide's editor's do you two use? zend's use of javaw is killing my > win2k3 dev machine anyways. # dd if=/dev/tty of=/dev/hda1 And then sometimes I also use vim. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http:

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread TG
Zend Studio does everything mentioned there. Tabs as spaces, tab/shift-tab, auto-indent. -TG - Original Message - From: Nathan Rixham <[EMAIL PROTECTED]> To: php-general@lists.php.net Date: Thu, 28 Feb 2008 20:43:07 + Subject: Re: [PHP] Sometimes I wonder why I even started program

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Eric Butera
On Thu, Feb 28, 2008 at 3:43 PM, Nathan Rixham <[EMAIL PROTECTED]> wrote: > [snip] > > Eric Butera wrote: > > I can hit tab and shift/tab too and it puts in spaces for me. > [snip] > > Robert Cummings wrote: > > Uhhhm, I hit the tab button also and it does the right thing (namely > > inserts

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread TG
Should always use a monospace font in editors, so you should never have a problem with font size differences. A space is as wide as an "I", etc. I don't remember what the default was, but my main editor is set for "Courier New", Notepad in Vista defaults to "Lucida Console". I have a friend w

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread TG
I use spaces, but just configure my editor to substitute spaces for TAB. That is, I still use tab/shift+tab, but they come out as spaces (how many ever I configure it to use.. currently I prefer 4). Good points were made for using tab vs spaces though, I may have to reconsider. Just somethin

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Ray Hauge
Nathan Rixham wrote: [snip] Eric Butera wrote: I can hit tab and shift/tab too and it puts in spaces for me. [snip] Robert Cummings wrote: > Uhhhm, I hit the tab button also and it does the right thing (namely > inserts 4 spaces). Also, when I hit enter it auto tabs. [snip] *kicks zend studi

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Shawn McKenzie
Nathan Rixham wrote: > [snip] > Eric Butera wrote: >> I can hit tab and shift/tab too and it puts in spaces for me. > [snip] > Robert Cummings wrote: >> Uhhhm, I hit the tab button also and it does the right thing (namely >> inserts 4 spaces). Also, when I hit enter it auto tabs. > [snip] > > *kic

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Nathan Rixham
[snip] Eric Butera wrote: I can hit tab and shift/tab too and it puts in spaces for me. [snip] Robert Cummings wrote: > Uhhhm, I hit the tab button also and it does the right thing (namely > inserts 4 spaces). Also, when I hit enter it auto tabs. [snip] *kicks zend studio* [and nano and textpad

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Eric Butera
On Thu, Feb 28, 2008 at 3:25 PM, Nathan Rixham <[EMAIL PROTECTED]> wrote: > > Robert Cummings wrote: > > On Thu, 2008-02-28 at 19:37 +, Stut wrote: > >> On 28 Feb 2008, at 19:17, Wolf wrote: > >>> Jason Pruim wrote: > My editor automatically replaces like 4 spaces with a tab... Is > >

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Robert Cummings
On Thu, 2008-02-28 at 20:25 +, Nathan Rixham wrote: > > I use tab's in all my code, and replace them with spaces when > posting/mailing for legibility. > > couldn't imagine ever hitting space 4/8/12/16+ times to write a line of > code when i can just tab/shit+tab to indent. Uhhhm, I hit the

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Shawn McKenzie
Nathan Rixham wrote: > Robert Cummings wrote: >> On Thu, 2008-02-28 at 19:37 +, Stut wrote: >>> On 28 Feb 2008, at 19:17, Wolf wrote: Jason Pruim wrote: > My editor automatically replaces like 4 spaces with a tab... Is > there a reason not to use tabs instead of spaces? :) I

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Nathan Rixham
Robert Cummings wrote: On Thu, 2008-02-28 at 19:37 +, Stut wrote: On 28 Feb 2008, at 19:17, Wolf wrote: Jason Pruim wrote: My editor automatically replaces like 4 spaces with a tab... Is there a reason not to use tabs instead of spaces? :) I use spaces since when I indent with 4 spaces it

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Nathan Rixham
Eric Butera wrote: HI Nathan, Sorry I soured your day. This is a public mailing list and it is my Ahh it's okay - I think I may have read into it a little too much anyways; likewise apologies. position that people who commit code to it should really make sure that it is reasonably sound. The

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Per Jessen
Stut wrote: >>> Ask random people in the IT world what they think about PHP. >>> I bet you'll hear lots of FUD about it being insecure. Why is it >>> insecure? >> >> 1) it's (mostly) interpreted >> 2) it's type-weak > > There is nothing inherently insecure contained within either of those > feat

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Robert Cummings
On Thu, 2008-02-28 at 19:37 +, Stut wrote: > On 28 Feb 2008, at 19:17, Wolf wrote: > > Jason Pruim wrote: > >> My editor automatically replaces like 4 spaces with a tab... Is > >> there a reason not to use tabs instead of spaces? :) > > > > I use spaces since when I indent with 4 spaces it i

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Eric Butera
On Thu, Feb 28, 2008 at 2:16 PM, Nathan Nobbe <[EMAIL PROTECTED]> wrote: > all, > > as we have discussed previously, php does not have support for retrieving > array values on the same line in which they are returned. i have created a > simple workaround, and would like to share. first there i

Re: [PHP] Flexible Shopping Cart (was: Shopping Carts)

2008-02-28 Thread Shawn McKenzie
Robert Cummings wrote: > On Thu, 2008-02-28 at 14:23 -0500, Daniel Brown wrote: >> On Thu, Feb 28, 2008 at 2:10 PM, Eric Butera <[EMAIL PROTECTED]> wrote: >>> Have you messed around with compressing your output at all? Using >>> something like mod_deflate is pretty nice while falling back on the

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Stut
On 28 Feb 2008, at 19:19, Per Jessen wrote: Eric Butera wrote: HI Nathan, Sorry I soured your day. This is a public mailing list and it is my position that people who commit code to it should really make sure that it is reasonably sound. These emails get archived forever and people can searc

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Nathan Nobbe
On Thu, Feb 28, 2008 at 2:36 PM, Ray Hauge <[EMAIL PROTECTED]> wrote: > That's pretty cool. I wasn't sure if it would work with numerically > indexed arrays, so I tried: > > // sillyFunc returns array(0=>1, 1=>2); > > ArrayClass::create(sillyFunc())->{"0"} > > I just tested it, and that works. I

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Stut
On 28 Feb 2008, at 19:17, Wolf wrote: Jason Pruim wrote: My editor automatically replaces like 4 spaces with a tab... Is there a reason not to use tabs instead of spaces? :) I use spaces since when I indent with 4 spaces it is significantly easier to read the code then with 4 tabs... 4

Re: [PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Ray Hauge
Nathan Nobbe wrote: all, as we have discussed previously, php does not have support for retrieving array values on the same line in which they are returned. i have created a simple workaround, and would like to share. first there is the class (w/ other features omitted for the post) theArray =

Re: [PHP] Cannot even come up with the beginning of a regex

2008-02-28 Thread Dotan Cohen
Alright, now that I've confirmed that preg_replace can work with UTF-8, I'm back to my original regex: $test="כאכ כ ככ ח"; $test=preg_replace( '/\bכ/u' , 'ך' , $test); print $test; print "$text"; This _should_ change the letter "כ" to "ך" only if it is at the end of a word. Can anyone push me in

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread TG
And the kerning.. OH THE KERNING! - Original Message - From: "Daniel Brown" <[EMAIL PROTECTED]> To: "Per Jessen" <[EMAIL PROTECTED]> Cc: php-general@lists.php.net Date: Thu, 28 Feb 2008 14:26:29 -0500 Subject: Re: [PHP] Sometimes I wonder why I even started programming... > On Thu, Feb

Re: [PHP] Flexible Shopping Cart (was: Shopping Carts)

2008-02-28 Thread Robert Cummings
On Thu, 2008-02-28 at 14:23 -0500, Daniel Brown wrote: > On Thu, Feb 28, 2008 at 2:10 PM, Eric Butera <[EMAIL PROTECTED]> wrote: > > Have you messed around with compressing your output at all? Using > > something like mod_deflate is pretty nice while falling back on the ob > > gz stuff makes a

Re: [PHP] Choose Your Common Design Patterns

2008-02-28 Thread Wolf
skylark wrote: Hi guys, Relex a little on the topic "What design patterns do you usually use". Choose the ones you use often at: http:// phparch [dot] cn And this will answer that question, isn't it? Those options are the ones that we often use. If there is any option needed to be replaced, jus

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Jason Pruim
On Feb 28, 2008, at 2:17 PM, Wolf wrote: Jason Pruim wrote: On Feb 28, 2008, at 11:11 AM, Philip Thompson wrote: On Feb 27, 2008, at 4:51 PM, Jochem Maas wrote: Jason Pruim schreef: I think the real question is... why are you using tabs instead of spaces? =D ~Philip My editor automati

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Daniel Brown
On Thu, Feb 28, 2008 at 2:22 PM, Per Jessen <[EMAIL PROTECTED]> wrote: > Yes. The length of a space does not vary from one system to another. Though the width can. ;-P Think fixedsys on a terminal versus Trebuchet TTF with hinting and antialiasing. Just going geek a bit on that. -

Re: [PHP] Flexible Shopping Cart (was: Shopping Carts)

2008-02-28 Thread Wolf
Nathan Rixham wrote: getLoadedProductCollection()?> getSize()):?> __('There are no products matching the selection.')?> first 5 lines I've seen of it and it's got short-tags, escapes in and out of php/html, no templating engine and no language file, or even concideration of future implementa

Re: [PHP] Flexible Shopping Cart (was: Shopping Carts)

2008-02-28 Thread Daniel Brown
On Thu, Feb 28, 2008 at 2:10 PM, Eric Butera <[EMAIL PROTECTED]> wrote: > Have you messed around with compressing your output at all? Using > something like mod_deflate is pretty nice while falling back on the ob > gz stuff makes a huge improvement too. I have, but the improved performance

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Per Jessen
Jason Pruim wrote: > My editor automatically replaces like 4 spaces with a tab... Is there > a reason not to use tabs instead of spaces? :) Yes. The length of a space does not vary from one system to another. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscrib

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Per Jessen
Eric Butera wrote: > HI Nathan, > > Sorry I soured your day. This is a public mailing list and it is my > position that people who commit code to it should really make sure > that it is reasonably sound. These emails get archived forever and > people can search them to find results, so what we

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Wolf
Jason Pruim wrote: On Feb 28, 2008, at 11:11 AM, Philip Thompson wrote: On Feb 27, 2008, at 4:51 PM, Jochem Maas wrote: Jason Pruim schreef: I think the real question is... why are you using tabs instead of spaces? =D ~Philip My editor automatically replaces like 4 spaces with a tab..

RE: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Jay Blanchard
[snip] Sorry I soured your day. This is a public mailing list and it is my position that people who commit code to it should really make sure that it is reasonably sound. These emails get archived forever and people can search them to find results, so what we put on here is long-lasting. [/snip]

[PHP] echo returnArray()['a']; // workaround

2008-02-28 Thread Nathan Nobbe
all, as we have discussed previously, php does not have support for retrieving array values on the same line in which they are returned. i have created a simple workaround, and would like to share. first there is the class (w/ other features omitted for the post) theArray = $theArray; }

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Daniel Brown
On Thu, Feb 28, 2008 at 1:39 PM, Nathan Rixham <[EMAIL PROTECTED]> wrote: > One thing I don't understand, why did you go all out and personal on > Dan? I'm not even going to go into it, you were bang out of order order > and you owe the man an apology; no need to explain what you meant, we > a

Re: [PHP] Flexible Shopping Cart (was: Shopping Carts)

2008-02-28 Thread Eric Butera
On Thu, Feb 28, 2008 at 2:03 PM, Daniel Brown <[EMAIL PROTECTED]> wrote: > On Thu, Feb 28, 2008 at 1:33 PM, Eric Butera <[EMAIL PROTECTED]> wrote: > > It is a svn repo showing the code to a product page to which you > > design with styles instead of tables. > > D'oh! Didn't even notice tha

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Eric Butera
On Thu, Feb 28, 2008 at 1:39 PM, Nathan Rixham <[EMAIL PROTECTED]> wrote: > > Eric Butera wrote: > > On Thu, Feb 28, 2008 at 12:38 PM, Daniel Brown <[EMAIL PROTECTED]> wrote: > >> On Thu, Feb 28, 2008 at 12:36 PM, Eric Butera <[EMAIL PROTECTED]> wrote: > >> > And I'd appreciate it if you kept a

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Wolf
All my point is that I've been on this list for a while. I've posted code and watched people just copy and paste it. I've watched other people copy and paste their examples. I used to say sanitize your data and watch the same exact thing in their new function coming back at me without any sanit

Re: [PHP] Flexible Shopping Cart (was: Shopping Carts)

2008-02-28 Thread Daniel Brown
On Thu, Feb 28, 2008 at 1:33 PM, Eric Butera <[EMAIL PROTECTED]> wrote: > It is a svn repo showing the code to a product page to which you > design with styles instead of tables. D'oh! Didn't even notice that. Sorry, my fault. I've been (slowly) migrating from tables to styles myself

Re: [PHP] Traverse directory - Find empty directory

2008-02-28 Thread Jim Lucas
Holografix wrote: Hi I'm using Spl RecursiveDirectoryIterator to traverse a directory and have no problem with it but now I'm stuck. I only need to display directories with no files in it. Can someone help with this? My current code: set_time_limit(0); $files = new RecursiveIteratorIterat

Re: [PHP] Flexible Shopping Cart (was: Shopping Carts)

2008-02-28 Thread Nathan Rixham
getLoadedProductCollection()?> getSize()):?> __('There are no products matching the selection.')?> first 5 lines I've seen of it and it's got short-tags, escapes in and out of php/html, no templating engine and no language file, or even concideration of future implementation. and is all tha

Re: [PHP] Sometimes I wonder why I even started programming...

2008-02-28 Thread Nathan Rixham
Eric Butera wrote: On Thu, Feb 28, 2008 at 12:38 PM, Daniel Brown <[EMAIL PROTECTED]> wrote: On Thu, Feb 28, 2008 at 12:36 PM, Eric Butera <[EMAIL PROTECTED]> wrote: > And I'd appreciate it if you kept all your posts about wearing dresses > to yourself but it isn't going to happen. :) Heh

Re: [PHP] Flexible Shopping Cart (was: Shopping Carts)

2008-02-28 Thread Eric Butera
On Thu, Feb 28, 2008 at 1:32 PM, Daniel Brown <[EMAIL PROTECTED]> wrote: > On Thu, Feb 28, 2008 at 1:26 PM, Eric Butera <[EMAIL PROTECTED]> wrote: > > Magento is designed with css. But I know right now that you won't like > it. ;) > > Because their server doesn't have PHP configured properl

Re: [PHP] Flexible Shopping Cart (was: Shopping Carts)

2008-02-28 Thread Daniel Brown
On Thu, Feb 28, 2008 at 1:26 PM, Eric Butera <[EMAIL PROTECTED]> wrote: > Magento is designed with css. But I know right now that you won't like it. > ;) Because their server doesn't have PHP configured properly? ;-P > Here is an example page: > > http://svn.magentocommerce.com/source/

  1   2   >