When AWS data isn't available for the reviews, the rating, etc., how do you display something like "Not available"?
Printable View
When AWS data isn't available for the reviews, the rating, etc., how do you display something like "Not available"?
I just use if statements. Like if the value of AverageCustomerRating is equal to 0, I echo No rating available.
How would you do this with the reviews?
Same way.
You would use 0 as a value if no reviews are available?
Would that work?PHP Code:
if $Reviews = "0" then echo "No reviews available."
PHP Code:
if (is_array($details['Reviews']['CustomerReviews'])) {
// The reviews are available
} else {
// No reviews
echo "No Reviews";
}