KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
i am doing a stuff in php and not it is debug mode. So i am us error_reporting(E_ALL); but When i try to access any character of string it gives me error due to the error reporting. $sentence = "Hello World"; $sentence[0] //Uninitialized string offset: 0 edited: public static function prepareSentence($sentence) { $sentence = trim($sentence); if ($sentence[0] == '"') //Uninitialized string offset: 0 $sentence = substr($sentence, 1, strlen($sentence)); if ($sentence[strlen($sentence) - 1] == '"') $sentence = substr($sentence, 0, -1); if ($sentence[0] == '"' || $sentence[strlen($sentence) - 1] == '"') return self::prepareSentence($sentence); return $sentence; } How should I do in order to work in dev mode. I need the error_reporting(E_ALL); thanks in advance.
Tags (comma-separated)
Save Edits
Cancel