Reply to Re: not displaying null data when using number_format

Your name:

Reply:


Posted by linda on 11/01/06 20:11

"Steve" <no.one@example.com> wrote in message
news:3L62h.37$vj4.6@newsfe07.lga...
>| > as for php, my goal is to have php parse as little as possible. this
> | > includes using ' instead of " when i am not embedding php variables or
> |
> | OK yeah, when I first started I used the apostrophe so that i could
> write
> | html with double quotes inside php with no errors. Then I just started
> | using mainly double quotes. Is there a great difference in speed?
>
> ok, no, to be honest. for *any* programming language you use whether
> compiled or scripted, the total amount of time spent processing *your*
> actual code is on the order of nano-seconds. there are exceptions however.

OK so not enough to make me notice any difference.

> BUT, if i have control of something, i ought to be responsible enough to
> write it effectively *and* efficiently. further, that getting into that
> habit will let you remain happily unaware of the the exceptions are. ;^)

Granted when you put it that way, it does make sense.

> | Yes but I thought there was a compatibility problem with some of it?
>
> only where either the programmer doesn't program correctly or the server
> admin doesn't setup php properly in the first place. the example i'm
> thinking of is when using xml related things.
>
> xml usually starts like this:
>
> <?xml

I've read many articles on xml and php, on the php website. And many work
arounds for different functions. Most of which went right over my head! ;-)

> strictly speaking, php is supposed to start explicitly like this:
>
> <?php
>
> when usually, php programmers use:
>
> <?
>
> to start php processing what is inbetween.
>
> if the server is set up to support <? as a php tag (which it does by
> default) AND all web requests are funnelled through php, then requesting
> http://www.example.com/someXml.xml will have disasterous results.
>
> even if it is setup correctly (to only give to php to process things that
> ARE php), a php script could have its sole purpose be to create xml
> dynamically. in that case, using a tic (') instead of a quote (") will
> allow
> one to build it without error.

Ok that makes sense.

> there are other issues, but are all easily handled...and i gain much by
> using short-tags.

I can understand the time issue, it does take longer, or should I say it
did. Since starting php I've amassed lots of my own code snippets only a
click away.

> | And
> | that if "god forbid" I should have to change hosts and they didn't have
> | this set up I would then need to re-edit all code. Which is why I stuck
> | with the <?php instead of the short hand version same with the echoed
> | variable etc? Which ones are major compatibility problems? As I wasn't
> | sure, well you get the picture.
>
> it is a good point, however most server's default configuration is to
> support them. second, the replacement is EASY! a well-written regular
> expression can fix all the occurances in moments. however, it's kind of a
> mute point. you will know BEFORE you ever write a line of code for someone
> whether or not they want you using them...or if they have set the server
> to
> support short-tags. if it is something of your own, you can decide what
> *you* want to do. if your host has it setup so that they aren't supported,
> yet you want them, use ini_set and enable them. ;^)

> | OK turning them on is a no go as I don't have access to the ini file, so
> how
> | would the second option be implemented into a script?
>
>
> try to turn them on:
>
> ini_set('short_open_tag', 'On');
>
> put that at the top of your script as the first line. then try it out.
>
They are on atm on the present server, but I just wanted to know just
in-case I every happen upon a set up where they are not enabled.

Best wishes,
Linda

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация