mistake appear on operation?
lima-city → Forum → Programmiersprachen → PHP, MySQL & .htaccess
-
<?
$subject=$rows[1];
$i=15;
if (strlen($subject)>$i)
{
$sub=substr($subject,0,$i)
echo "$sub";
}
else
{
echo "$subject";
}
?>
this is that one passage omits the code demonstrating information's , seem to have no mistake , it is operation not to come out always saying echo \"$sub\"; having a mistake but, -
Diskutiere mit und stelle Fragen: Jetzt kostenlos anmelden!
lima-city: Gratis werbefreier Webspace für deine eigene Homepage
-
<?
$subject=$rows[1];
$i=15;
if (strlen($subject)>$i)
{
$sub=substr($subject,0,$i)
echo "$sub";
}
else
{
echo "$subject";
}
?>
this is that one passage omits the code demonstrating information's , seem to have no mistake , it is operation not to come out always saying echo \"$sub\"; having a mistake but,
test it so:
<?php $subject=$rows[1]; $i=15; if (strlen($subject)>$i) { $sub=substr($subject,0,$i) echo $sub; } else { echo $subject; } ?>
-
this is that one passage omits the code demonstrating information's , seem to have no mistake , it is operation not to come out always saying echo \"$sub\"; having a mistake but,
There ist a error message from your PHP interpreter?
In general please post the Error message of the PHP interpreter.
Cause it's much easyer if we'd know exactly which error occures.
I've found the failure
$sub=substr($subject,0,$i); <<<<< this line needs a Semicolon
-
Diskutiere mit und stelle Fragen: Jetzt kostenlos anmelden!
lima-city: Gratis werbefreier Webspace für deine eigene Homepage