Normalize a form value and build a short status.

Form Summaries

form_summary.php
<?php
$name = ;
$trimmed = trim($name);
$status = $trimmed === "" ? "missing" : "ready";
$summary = $status === "ready" ? "hello " . $trimmed : "name missing";

echo "status=" . $status . "\n";
echo "summary=" . $summary . "\n";
<?php
$name = ;
$trimmed = trim($name);
$status = $trimmed === "" ? "missing" : "ready";
$summary = $status === "ready" ? "hello " . $trimmed : "name missing";

echo "status=" . $status . "\n";
echo "summary=" . $summary . "\n";
<?php
$name = ;
$trimmed = trim($name);
$status = $trimmed === "" ? "missing" : "ready";
$summary = $status === "ready" ? "hello " . $trimmed : "name missing";

echo "status=" . $status . "\n";
echo "summary=" . $summary . "\n";
form-summary Form data should be normalized before a handler decides what to do next. This example keeps the form value local and scalar for replay.