note 129430 added to function.session-save-path

From: Date: Thu, 25 Apr 2024 09:38:43 +0000
Subject: note 129430 added to function.session-save-path
Groups: php.notes 
Request: Send a blank email to php-notes+get-221306@lists.php.net to get a copy of this message
This function seems to simply return the value of session.save_path from the [Session] section of php.ini. This has an important implication: the returned value can as well look like "0;0660;/var/lib/php/sessions", which is of course no valid path. A way to extract the path despite the possible semicolons can be something like: $ssp = explode(';', session_save_path()); echo end($ssp); As end takes the array by reference, it's not possible to make a real one-liner without relying on an intermediate variable. ---- Server IP: 45.112.84.4 Probable Submitter: 80.90.13.131 (proxied: 2001:620:618:194:1:80b2:9415:1) ---- Manual Page -- https://php.net/manual/en/function.session-save-path.php Edit -- https://main.php.net/note/edit/129430 Del: integrated -- https://main.php.net/note/delete/129430/integrated Del: useless -- https://main.php.net/note/delete/129430/useless Del: bad code -- https://main.php.net/note/delete/129430/bad+code Del: spam -- https://main.php.net/note/delete/129430/spam Del: non-english -- https://main.php.net/note/delete/129430/non-english Del: in docs -- https://main.php.net/note/delete/129430/in+docs Del: other reasons-- https://main.php.net/note/delete/129430 Reject -- https://main.php.net/note/reject/129430 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#221306) next »