Re: [PHP] FUNCTION TO CHECK IMAGE

2006-09-10 Thread BBC
> At 12:49 AM -0700 9/10/06, BBC wrote:
> >Hi all.
> >I'm having a problem regarding image handling. Sometimes an image 
> >can be showed in browser normally (in my computer) but when I
> >upload it into my site that image is not valid, so there is an issue 
> >in my getimagesizes() function.
> >Is there any function to recover such problem? I used 
> >"if(file_exists($image_path))" but it couldn't solve the problem.
> >Input would be appreciated
> >
> 
> How are you uploading your image?
I upload a file through some form then I manipulate it's size

> 
> What is reporting your image is not valid?
> 
Size of image can't be define seem's like the image is not there, but it's not  
happened all the time.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] FUNCTION TO CHECK IMAGE

2006-09-10 Thread BBC
> BBC wrote:
> > Hi all.
> > I'm having a problem regarding image handling. Sometimes an image can be 
> > showed in browser normally (in my computer) but when I
> > upload it into my site that image is not valid, so there is an issue in my 
> > getimagesizes() function.
> > Is there any function to recover such problem? I used 
> > "if(file_exists($image_path))" but it couldn't solve the problem.
> > Input would be appreciated
>
> - From what it sounds like you are doing, you are uploading a file through
> some form, then manipulating it's size. Is this correct?

Yes it is, but the uploading was going well (size is ok). When I show the image 
on the web using getimagesizes(), 'sometimes' such
image size couldn't be resolved.
Is there any function to define that image is ok or not?

> What happens when you stop manipulating it's size and try to view just the 
> uploaded
> file?

Size of image (after or before uploading) would be same. but the issue still 
there (sometimes)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Date maths

2006-09-10 Thread Paul Scott

Dave, 

Luckily for you there is a whole whack of functions made specifically
for these issues...

On Sun, 2006-09-10 at 21:19 +0100, Dave Goodchild wrote:
> So, when an event-holder enters a repeating event, the main event details
> are held in the events table, and all the relevant dates for the event (they
> specify the first date of the event and the last date it is to be held) are
> entered into the calendar table by increment (ie timestamp intervals by 24
> hours, 7 days or monthly, and I know monthly is going to be tricky as it is
> a fluctuating interval).
> 

Have a look at the PHP manual entries for date() and strtotime(). There
are a few others, but this should get you well started!

There is also a PEAR::Date object that you may find useful, as well as a
calendar object IIRC. 

There are a few basics that you want to keep in mind though:

1. strtotime works well, but make sure that your date/time strings
conform to the GNU datetime specs.

2. There are 86400 seconds in a day.

3. Date also accepts parameters like +1month and -1month, this works for
days, weeks, months etc. 

4. Google "php calendar class and php date class" you will get like a
bazillion resources that will really help out.

HTH a bit...

--Paul



All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Ajax and PHP: XMLHTTP

2006-09-10 Thread Micky Hulse



Can I replace the above with some sort of XMLHTTP request?

Googling now... thought I would ask here first.

Any good links to tuts that might cover that sort of thing?

Kinda thinking about plugging some Ajax into a random image php script.

TIA. :)
Cheers,
Micky

--
 Wishlist: 
   Switch: 
 BCC?: 
   My: 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP 4 OOP, re-using a object?

2006-09-10 Thread Micky Hulse

Christopher Weldon wrote:

What's the error, and how do you have the class and functions defined?


Hi Christopher, thanks for asking.  :)

Actually, it was one of those silly, right in front of my face, logic 
errors...


class RandomSplash {
var $alphabet = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 
'k', 'l', 'm');

function randomize($what) {
switch($what) {
case 'css':
$data = $this->$alphabet;
...
...
...
}
}

See the error?

$data = $this->$alphabet;

should've been:

$data = $this->alphabet;

At first I thought it was how I was calling the class... all works now 
though.  :)


Thanks for asking. Let me know if you see a better way to do the above 
though, I am pretty new to using classes, but I am pretty handy when it 
comes to functions. :D


Thanks,
Cheers,
Micky

--
 Wishlist: 
   Switch: 
 BCC?: 
   My: 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP 4 OOP, re-using a object?

2006-09-10 Thread Christopher Weldon
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Micky Hulse wrote:
> Micky Hulse wrote:
>> Any help, even a RTFM link, would be really appreciated. :)
> 
> Hi all,
> 
> A fellow list member gave answered my question off-list and pointed me
> here:
> 
> http://www.php.net/oop
> 
> Going to (re)read... It has been a while since I last worked with
> classes. :)
> 
> I asked because I was getting an error with my code... I thought it was
> how I was calling it.
> 
> Anyway, have a great day,
> Cheers,
> Micky
> 
> 

What's the error, and how do you have the class and functions defined?

- --
Christopher Weldon, ZCE
President & CEO
Cerberus Interactive, Inc.
[EMAIL PROTECTED]
979.739.5874
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFBMjMZxvk7JEXkbERArjTAKCVd57A8Pj+aoaY0iF4BU/5A1dmawCeP3ku
h4bOmUAeBphVXvOfnnpOwUQ=
=JPWQ
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP 4 OOP, re-using a object?

2006-09-10 Thread Micky Hulse

Micky Hulse wrote:

Any help, even a RTFM link, would be really appreciated. :)


Hi all,

A fellow list member gave answered my question off-list and pointed me here:

http://www.php.net/oop

Going to (re)read... It has been a while since I last worked with 
classes. :)


I asked because I was getting an error with my code... I thought it was 
how I was calling it.


Anyway, have a great day,
Cheers,
Micky


--
 Wishlist: 
   Switch: 
 BCC?: 
   My: 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: PHP 4 OOP, re-using a object?

2006-09-10 Thread M. Sokolewicz

Micky Hulse wrote:

Hi,

I am slowly learning how to use classes properly... quick question:

# Create the object:
$doSplash = new RandomSplash(); // Create the object.

Shouldn't I be able to call that object like below, throughout my page:

...HTML...
randomize('css'); ?>
...HTML...
randomize('xhtml top'); ?>
...HTML...
randomize('xhtml bot'); ?>
...HTML...

Sorry, this is probably a noob question... I am pretty good at using 
functions, but classes are still new to me.


Any help, even a RTFM link, would be really appreciated. :)

Have a great day!
Cheers,
Micky


you should be able to, and it works fine for me. www.php.net/oop will 
help, if you haven't read it.


- tul

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP 4 OOP, re-using a object?

2006-09-10 Thread Micky Hulse

Hi,

I am slowly learning how to use classes properly... quick question:

# Create the object:
$doSplash = new RandomSplash(); // Create the object.

Shouldn't I be able to call that object like below, throughout my page:

...HTML...
randomize('css'); ?>
...HTML...
randomize('xhtml top'); ?>
...HTML...
randomize('xhtml bot'); ?>
...HTML...

Sorry, this is probably a noob question... I am pretty good at using 
functions, but classes are still new to me.


Any help, even a RTFM link, would be really appreciated. :)

Have a great day!
Cheers,
Micky

--
 Wishlist: 
   Switch: 
 BCC?: 
   My: 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Newbie question about

2006-09-10 Thread Satyam


- Original Message - 
From: "Jon Anderson" <[EMAIL PROTECTED]>

To: 
Cc: "Al" <[EMAIL PROTECTED]>
Sent: Sunday, September 10, 2006 9:16 PM
Subject: Re: [PHP] Re: Newbie question about 



Al wrote:
Structurally, there is a far better way to compile your html pages.  This 
approach is easier to design and debug and it is faster since it sends 
one complete packet instead of one for every short tag. And, it saves 
using ob_start() and ob_flush().


Consider:

$report= '';

$report .= function() [or whatever]

. repeat as necessary to assemble your complete page.

Then simply

echo $report;
I thought I'd look into this, because I'm a bit of a performance nut - I 
like  my code to run as fast as possible at all times. I wrote up a quick 
buffer v.s. direct "benchmark" for this, and the winner is clear: direct 
output is much faster. (If my example below isn't  what you meant, please 
let me know. I'm always happy to hear  new ways  to improve my code.)


Best of 3 runs with apache bench (concurrency 10, 1000 requests total):
Direct output: 582 requests a second
Buffer var: 286 requests a second

I believe the margin would get wider with real-world usage, as the buffer 
variable would increase in size. My test code is copied below.


jon

--- "Direct output": testecho.php ---




style1 {
   a = 1;
   b = 2;
   c = 3;
   d = 4;
   e = 5;
   f = 6;
}
style2 {
   a = 1;
   b = 2;
   c = 3;
   d = 4;
   e = 5;
   f = 6;
}
style3 {
   a = 1;
   b = 2;
   c = 3;
   d = 4;
   e = 5;
   f = 6;
}
style4 {
   a = 1;
   b = 2;
   c = 3;
   d = 4;
   e = 5;
   f = 6;
}





   X is 





--- "Buffered output": testbuffer.php ---




style1 {
   a = 1;
   b = 2;
   c = 3;
   d = 4;
   e = 5;
   f = 6;
}
style2 {
   a = 1;
   b = 2;
   c = 3;
   d = 4;
   e = 5;
   f = 6;
}
style3 {
   a = 1;
   b = 2;
   c = 3;
   d = 4;
   e = 5;
   f = 6;
}
style4 {
   a = 1;
   b = 2;
   c = 3;
   d = 4;
   e = 5;
   f = 6;
}


';

for ($x=0;$x<1000;$x++) {
   $buffer .= "X is $x";
}

$buffer .= '
';

echo $buffer;
?>

--
In my message I was careful to mention that stepping in and out of PHP was 
good 'for the longer invariable  parts of immutable HTML'.  What could be 
considered 'longer' is certainly a matter discussion, your results prove 
that this is not long enough.  Notice that when the parser finds the 'it converts it into the equivalent of "not explicitly there, from the parser on is as if it were.   Then, since you 
have an echo, why not use it for all of the output?The equivalent to 
what I showed as the second best, which would be the first best with 
'shorter' strings would be the following:


for ($x=0;$x<1000;$x++) {
   echo ' X is ' , $x , '';
}

Can you try and time that one so we have comparable results?  This one 
should be second best:


for ($x=0;$x<1000;$x++) {
   echo "X is $x";
}

Back again to what would be 'longer', well, in your example, the whole 
header, up to the loop itself should be faster if sent out of PHP. 
Likewise, you could echo $buffer right after the loop, drop out of PHP and 
send the footer as plain HTML.  This, of course, is harder to time since it 
happens only once.  I admit though that I did time the options I listed and 
on the 'dropping in and out of PHP' I'm relying on the PHP manual ( see 
http://www.php.net/manual/en/language.basic-syntax.php, the first paragraph 
after the examples) and the source of the lexical scanner, which supports 
that, though your numbers do contradict it.  Interesting.


Satyam

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Date maths

2006-09-10 Thread Dave Goodchild

Hi all. I am in the midst of creating a national online events directory (ie
evening classes, coffee mornings, yard sales etc). The user is able to enter
one-off events or regular events (daily, weekly, monthly) and each event
entered makes up one record in the events table in the db (mysql). People
are then able to enter a start and end date and the system will show all
events that meet their criteria (category, postcode within a certain
radius).

My problem is with repeating events. My thinking at the moment is to utilise
a calendar table, which contains event id as a foreign key and relevant
dates. All dates are held in the database as timestamps.

So, when an event-holder enters a repeating event, the main event details
are held in the events table, and all the relevant dates for the event (they
specify the first date of the event and the last date it is to be held) are
entered into the calendar table by increment (ie timestamp intervals by 24
hours, 7 days or monthly, and I know monthly is going to be tricky as it is
a fluctuating interval).

Has anyone out there had to deal with a similar problem, and if so do you
have any advice. This is going to take time so I will be patient and
continue, and welcome any suggestions. Many thanks and I can post code to
specific requests.

--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk


Re: [PHP] Re: Newbie question about

2006-09-10 Thread Jon Anderson

Al wrote:
Structurally, there is a far better way to compile your html pages.  
This approach is easier to design and debug and it is faster since it 
sends one complete packet instead of one for every short tag. And, it 
saves using ob_start() and ob_flush().


Consider:

$report= '';

$report .= function() [or whatever]

. repeat as necessary to assemble your complete page.

Then simply

echo $report;
I thought I'd look into this, because I'm a bit of a performance nut - I 
like  my code to run as fast as possible at all times. I wrote up a 
quick buffer v.s. direct "benchmark" for this, and the winner is clear: 
direct output is much faster. (If my example below isn't  what you 
meant, please let me know. I'm always happy to hear  new ways  to 
improve my code.)


Best of 3 runs with apache bench (concurrency 10, 1000 requests total):
Direct output: 582 requests a second
Buffer var: 286 requests a second

I believe the margin would get wider with real-world usage, as the 
buffer variable would increase in size. My test code is copied below.


jon

--- "Direct output": testecho.php ---




style1 {
   a = 1;
   b = 2;
   c = 3;
   d = 4;
   e = 5;
   f = 6;
}
style2 {
   a = 1;
   b = 2;
   c = 3;
   d = 4;
   e = 5;
   f = 6;
}
style3 {
   a = 1;
   b = 2;
   c = 3;
   d = 4;
   e = 5;
   f = 6;
}
style4 {
   a = 1;
   b = 2;
   c = 3;
   d = 4;
   e = 5;
   f = 6;
}





   X is 





--- "Buffered output": testbuffer.php ---




style1 {
   a = 1;
   b = 2;
   c = 3;
   d = 4;
   e = 5;
   f = 6;
}
style2 {
   a = 1;
   b = 2;
   c = 3;
   d = 4;
   e = 5;
   f = 6;
}
style3 {
   a = 1;
   b = 2;
   c = 3;
   d = 4;
   e = 5;
   f = 6;
}
style4 {
   a = 1;
   b = 2;
   c = 3;
   d = 4;
   e = 5;
   f = 6;
}


';

for ($x=0;$x<1000;$x++) {
   $buffer .= "X is $x";
}

$buffer .= '
';

echo $buffer;
?>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Newbie question about

2006-09-10 Thread Satyam


- Original Message - 
From: "Al" <[EMAIL PROTECTED]>

To: 
Sent: Sunday, September 10, 2006 5:52 PM
Subject: [PHP] Re: Newbie question about 



Mike Borrelli wrote:

Good day,

While I've been using php for more than a little while now, I've never
understood why the use of the "" short tag is noted "to be
avoided".

Or rather, I understand that there's an option to disable it, and that's
why it's noted in this way, but I don't understand why it's disabled? 
What's gained by writing  over 
some_function(); ?>

Thanks in advance.

Cheers,
Mike
Structurally, there is a far better way to compile your html pages.  This 
approach is easier to design and debug and it is faster since it sends one 
complete packet instead of one for every short tag. And, it saves using 
ob_start() and ob_flush().


Consider:

$report= '';

$report .= function() [or whatever]

. repeat as necessary to assemble your complete page.

Then simply

echo $report;



Actually, in my experience, that is not the case, my e-mail from more than a 
year ago must be somewhere there in the archives, but what you sugest is not 
the fastest.


The fastest is to escape out of php (with a ?> ) for the longer invariable 
parts of immutable HTML. Stepping out from PHP and in again is handled by 
the lexical scanner, it doesn't even reach the parser level so, for all 
effects, the PHP interpreter is basically frozen at the point before the ?> 
was found. For the sake of completeness, the ?> is translated as a ; for the 
parser so it ends any statement that could have been left open, but it does 
not bother the parser at all for all the rest of the characters found until 
a ?>, the following code would be valid:


echo 'This ' , ?> is For the variable parts, the best is to issue as little echos as possible 
with its arguments separated by commas, not with dots.  Most people don't 
realize that echo taks a list of arguments, a list separated by commas. 
Thus, in the ratings, from best to worst, it goes:


echo '' , $something, '';
echo "$something"
echo '' . $something . '';
echo ''; echo $something; echo '';

The reason for this is that generating a single string either from variable 
interpolation as in the second case or by concatenating the arguments, as in 
the third,  requires a lot of memory handling for the strings and its 
intermediate and final results.  Some of it might be delayed until the page 
is served so the time the garbage collector takes to clean it up might not 
be fully reflected in the processing time of a single page, but it does 
affect the overall throughput of the server.  Notice also that I have used 
single quotes whenever possible, which is slightly faster since the parser 
has much less to look for within it.


Finally, the first option is the fastest just as a C++ iostream or a Java 
StringBuffer are faster than plain strings: since you know you will only 
append to the end of them, the characters echoed go into a much more 
efficient character buffer instead of a more complex string which has to be 
available for all sorts of string operations.


Satyam

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] FUNCTION TO CHECK IMAGE

2006-09-10 Thread Christopher Weldon
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

BBC wrote:
> Hi all.
> I'm having a problem regarding image handling. Sometimes an image can be 
> showed in browser normally (in my computer) but when I
> upload it into my site that image is not valid, so there is an issue in my 
> getimagesizes() function.
> Is there any function to recover such problem? I used 
> "if(file_exists($image_path))" but it couldn't solve the problem.
> Input would be appreciated
> 
>  Best Regards
> BBC
>  **o<0>o**
> 

- From what it sounds like you are doing, you are uploading a file through
some form, then manipulating it's size. Is this correct? What happens
when you stop manipulating it's size and try to view just the uploaded
file?

- --
Christopher Weldon, ZCE
President & CEO
Cerberus Interactive, Inc.
[EMAIL PROTECTED]
979.739.5874
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFBDkiZxvk7JEXkbERArmiAJwLuA2Kk52/uhT6y8ptKEi/D6nkWQCcDa2M
R0uKdIwEaPBGBc14AoZQzo4=
=epdR
-END PGP SIGNATURE-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Newbie question about

2006-09-10 Thread Al

Mike Borrelli wrote:

Good day,

While I've been using php for more than a little while now, I've never
understood why the use of the "" short tag is noted "to be
avoided".

Or rather, I understand that there's an option to disable it, and that's
why it's noted in this way, but I don't understand why it's disabled? 
What's gained by writing  over 
some_function(); ?>

Thanks in advance.

Cheers,
Mike
Structurally, there is a far better way to compile your html pages.  This approach is easier to design and debug and it 
is faster since it sends one complete packet instead of one for every short tag. And, it saves using ob_start() and 
ob_flush().


Consider:

$report= '';

$report .= function() [or whatever]

. repeat as necessary to assemble your complete page.

Then simply

echo $report;

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: How could I make the browser to send a command to a cash register...

2006-09-10 Thread Alex Turner
Man-wai Chang wrote:
> to open its drawer?
> 
That 100% depends on how the cash register works.  Is it an NT cash
register, or an propitiatory one?  Is it rs232 or on a network?

Basically, find out how the cash register can be controlled, then make a
php script that can fire that control.

If you find out more about the register we might be able to help a
little more ;-)

Cheers

AJ

-- 
www.deployview.com
www.nerds-central.com
www.project-network.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] How could I make the browser to send a command to a cash register...

2006-09-10 Thread Man-wai Chang
to open its drawer?

-- 
  .~.   Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org
 / v \  Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Ubuntu 6.06)  Linux 2.6.17.13
  ^ ^   21:43:01 up 1 day 2:37 0 users load average: 0.02 0.03 0.00
news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] FUNCTION TO CHECK IMAGE

2006-09-10 Thread tedd

At 12:49 AM -0700 9/10/06, BBC wrote:

Hi all.
I'm having a problem regarding image handling. Sometimes an image 
can be showed in browser normally (in my computer) but when I
upload it into my site that image is not valid, so there is an issue 
in my getimagesizes() function.
Is there any function to recover such problem? I used 
"if(file_exists($image_path))" but it couldn't solve the problem.

Input would be appreciated



How are you uploading your image?

What is reporting your image is not valid?

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] FUNCTION TO CHECK IMAGE

2006-09-10 Thread BBC
Hi all.
I'm having a problem regarding image handling. Sometimes an image can be showed 
in browser normally (in my computer) but when I
upload it into my site that image is not valid, so there is an issue in my 
getimagesizes() function.
Is there any function to recover such problem? I used 
"if(file_exists($image_path))" but it couldn't solve the problem.
Input would be appreciated

 Best Regards
BBC
 **o<0>o**

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Newbie question about

2006-09-10 Thread Satyam


- Original Message - 
From: "Mike Borrelli" <[EMAIL PROTECTED]>

To: "Ray Hauge" <[EMAIL PROTECTED]>
Cc: ; "Mike Borrelli" <[EMAIL PROTECTED]>
Sent: Sunday, September 10, 2006 6:52 AM
Subject: Re: [PHP] Newbie question about 



Okay, after thinking about it, and looking at the replies, it seems as
though there is only one situation where the short tags break things, and
that's in XML with the  pair being valid for XML.



As I said  is not valid XML, it misses the code to identify the 
processor to deal with the contents.  XML expects what it calls a PITarget 
(PI being Processing Instruction, which is what this  pair is) 
right after the first question mark.



Yes, enabling the short tags is in the ini file, but is it on by default
and require effort to change?

That's the real question, I think.  Not, why shouldn't I use them the way
they are, but why is it that the  tag isn't designed into the
language to be acceptable?

Which language?   If it only was for PHP, anything could be designed into 
it, but it does not have the environment all to itself and it might have to 
coexist with other standards.  XML requires the PITarget, and that's it. 
Nevertheless, you are not required to be XML compatible in your setup and 
indeed, in most cases, this is irrelevant.



Honestly, the  pair just feels a little lazy, since all you save are
the 4 characters "php ", and all the code inside is the same.  The 
tag gives you 7 characters free and does something unique.

The situation I think of using it the most in is something such as:
 ...

Which looks cleaner, in my opinion, than:
 ...

Not a whole lot larger, no, and perhaps you might say, Well, the second
way is more explicit!  Yes.

Also, shouldn't it be possible to check for  and, based on the '='
there, pop out of the parser if it comes across  ?



xml is not the only valid PITarget out there, thus, you cannot parse 
everything but xml since the list of 'buts' is endless.  Anyway, if you care 
for XML compatibility , it is important that the at the beginning and that you don't use short tags, otherwise if you do not 
care for compatibility, then the normal string, which is a good thing since, after all, the text at the beginning is announcing that the whole document is xml 
compatible which, with short tags enabled, it is not.  The output of that 
script, which would include the echoed 

I personally don't care much for XML compatibility in my PHP scripts, I care 
that the output of those scripts is XML compatible, if it has to.  I still 
think the recomendation is valid though I am still to see any place which 
would deny itself the chance to run zillions of packages out there to 
achieve some theoretical compatibility at a point (PHP source code) where it 
is irrelevant.


Satyam



Cheers,
Mike


As was said before, the major reasons for not using short tags are:

1) Not everyone has access to the ini file, and might not be able to use
short
tags.  If you're releasing your code to the public, you want to work in 
as

many places as possible, so then you should use 

--
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
www.americanstudentloan.com
1.800.575.1099



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php