How can symbols be displayed instead of numbers in a PHP database query result?

To display symbols instead of numbers in a PHP database query result, you can use a conditional statement to check the value of the number and replace it with the corresponding symbol. For example, you can replace 1 with a checkmark symbol and 0 with a cross symbol. This can be achieved by using a simple if-else statement within the loop that fetches the database results.

// Assuming $result contains the database query result
foreach ($result as $row) {
    $value = $row['column_name']; // Assuming 'column_name' is the column containing numbers
    
    // Replace numbers with symbols
    if ($value == 1) {
        $symbol = '✓'; // Checkmark symbol
    } else {
        $symbol = '✗'; // Cross symbol
    }
    
    echo $symbol; // Display the symbol instead of the number
}