我有四個字符串長度語句我想驗證,但只有兩個正在工作。字符串長度問題
$name = "mike";
$age = "54";
$city = "Chicago";
$building = "Madadnock";
$lengthOfString1 = strlen ($name);
echo "String length of 'name' " . $lengthOfString1 . "</br>";
$lengthOfString2 = strlen ($age);
echo "String length of 'age' " . $lengthOfString2 . "</br>";
$lengthOfString3 = strlen ($city);
echo "String length of 'city' " . $lengthOfstring3 . "</br>";
$lengthOfString4 = strlen ($building);
echo "String length of 'building' " . $lengthOfstring4 . "</br>";
前兩位是唯一能夠工作的人。任何幫助將是偉大的!在PHP
添加關於最後兩條陳述不起作用的更多詳細信息 – RomanPerekhrest
此問題應該與[PHP:「Notice:Undefined variable」,「Notice:Undefined index」和「Notice:Undefined offset」重複關閉] (http://stackoverflow.com/questions/4261133/php-notice-undefined-variable-notice-undefined-index-and-notice-undef) –
旁註:''不是一個有效的標記標記; '
'是。 –