Easy with PHP ??
null coalescing operator
return $Row['Data'] ?? 'default value';
Or you can use as such
$Row['Data'] ??= 'default value';
return $Row['Data'];
More Related Contents:
- Why I am suddenly getting a “Typed property must not be accessed before initialization” error when introducing properties type hints?
- Message: Trying to access array offset on value of type null [duplicate]
- Array and string offset access syntax with curly braces is deprecated [duplicate]
- Trying to access array offset on value of type null
- PHP 7.4 deprecated get_magic_quotes_gpc function alternative
- What is null coalescing assignment ??= operator in PHP 7.4
- Why does PHP 7.4 on Windows aborts all command line actions that require user input?
- i need a PHP code to find longest contiguous sequence of characters in the string
- storing user_id in session variable
- New self vs. new static
- Passing an array to a query using a WHERE clause
- Seo Friendly URL results in CSS IMG and JS not working
- How to prevent form resubmission when page is refreshed (F5 / CTRL+R)
- PHP Array to JSON Array using json_encode(); [duplicate]
- pdo – Call to a member function prepare() on a non-object [duplicate]
- Accessing dates in PHP beyond 2038
- PHP returning JSON to JQUERY AJAX CALL
- How to make dot match newline characters using regular expressions
- How to disable output buffering in PHP
- PHP – Upload utf-8 filename
- Google Drive PHP API – Simple File Upload
- Subtract 1 day with PHP
- PHP recursive directory path
- Catching exceptions from Guzzle
- Accept function as parameter in PHP
- Laravel – How to get current user in AppServiceProvider
- Is it possible to visualize a bunch of functions in UML
- What Does Using A Single Pipe ‘|’ In A Function Argument Do?
- Laravel and view caching in development — can’t see changes right away
- Calling a function within a Class method?