Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
echo "題目一\n";
$ABC="php is great";
echo strtoupper($ABC)."\n";
echo str_replace("php is great","PHP IS AWESOME",$ABC)."\n";
echo "題目二\n";
$A1="Ethan Caldwell";
$A2="Lucas Harper";
$A3="Mason Bennett";
function getSingleNameLength(string $name)
{
$nameNoSpace = str_replace(" ", "", $name);
$length = strlen($nameNoSpace);
return $length ;
}
echo getSingleNameLength($A1);