How can ternary operators be nested in PHP, and what are the implications?

Ternary operators can be nested in PHP by using them within the conditional expressions of other ternary operators. This can be useful for creating more complex conditional logic in a concise manner. However, nesting ternary operators too deeply can make the code harder to read and maintain, so it's important to use them judiciously.

// Example of nested ternary operators
$result = ($condition1) ? ($condition2) ? 'both conditions met' : 'only condition1 met' : 'condition1 not met';
echo $result;