Basic question: function
<?php
function h()
{
echo 'hello';
}
?>
BIG
<? h(); ?>
Result with PHP4.3.10/Apache1.3.33 => BIGBIGhello
Result with PHP5.2.6/Apache2.2.3 => BIG
with PHP 5.2.6
hello is not displayed
why?
how can I fix this?
Thank you
Re: Basic question: function
Personne wrote:
> <?php
> function h()
> {
> echo 'hello';
> }
> ?>
> BIG
> <? h(); ?>
>
>
> Result with PHP4.3.10/Apache1.3.33 => BIGBIGhello
> Result with PHP5.2.6/Apache2.2.3 => BIG
>
> with PHP 5.2.6
> hello is not displayed
> why?
> how can I fix this?
There are two ways, configure php5 to use the short tags <?/?> or modify the
short tag to be a real tag <?php/?>.
I do suggest the later one, as you can get troubles when you need to use <?/?>
for something else like a xml header tag.
--
//Aho
Re: Basic question: function
Probably a little late, but try putting <?php h(); ?> instead of <? h(); ?>.
Martin
"Personne" <cpdivers [at] gmail.com> wrote in message
news:1182881288.107073.183430 [at] q75g2000hsh.googlegroups.com.. .
> <?php
> function h()
> {
> echo 'hello';
> }
> ?>
> BIG
> <? h(); ?>
>
>
> Result with PHP4.3.10/Apache1.3.33 => BIGBIGhello
> Result with PHP5.2.6/Apache2.2.3 => BIG
>
> with PHP 5.2.6
> hello is not displayed
> why?
> how can I fix this?
>
> Thank you
>