note 128441 added to function.trim
| From: | pcoates at yukon1000 dot com | Date: | Mon, 01 May 2023 19:23:20 +0000 |
| Subject: | note 128441 added to function.trim | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-220397@lists.php.net to get a copy of this message | ||
note there is a behaviour change in php 8
You used to be able to say:
$p1 = trim($_POST['p1']);
This will now throw deprecated warnings if parameter p1 is not set. It is better to say:
$p1 = trim($_POST['p1']??'');
or
$p1 = isset($_POST['p1']) ? trim($_POST['p1']) : null;
or
$p1 = isset($_POST['p1']) ? trim($_POST['p1']) : '';
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.13.130 (proxied: 50.117.144.107)
----
Manual Page -- https://php.net/manual/en/function.trim.php
Edit -- https://main.php.net/note/edit/128441
Del: integrated -- https://main.php.net/note/delete/128441/integrated
Del: useless -- https://main.php.net/note/delete/128441/useless
Del: bad code -- https://main.php.net/note/delete/128441/bad+code
Del: spam -- https://main.php.net/note/delete/128441/spam
Del: non-english -- https://main.php.net/note/delete/128441/non-english
Del: in docs -- https://main.php.net/note/delete/128441/in+docs
Del: other reasons-- https://main.php.net/note/delete/128441
Reject -- https://main.php.net/note/reject/128441
Search -- https://main.php.net/manage/user-notes.php