note 113898 added to function.stripos

From: Date: Sun, 15 Dec 2013 08:57:34 +0000
Subject: note 113898 added to function.stripos
Groups: php.notes 
Request: Send a blank email to php-notes+get-197935@lists.php.net to get a copy of this message
If you like using ternary operator, I wrote simple example how to use stripos function. Also, in my example I add "How to use namespaces" for wide knowledges for newbies. <?php namespace My; //You can be free using core functions in your NameSpaces (My) function stripos($haystack, $needle) { //To call core function (from global NS) you should add backslash only - \func return (FALSE === \stripos($haystack, $needle)) ? FALSE : TRUE; } var_dump(stripos($haystack = 'John knows English language.', $needle = 'john')); //TRUE var_dump(stripos($haystack = 'Sara knows English language too.', $needle = 'john')); //FALSE ?> ---- Server IP: 72.52.91.14 Probable Submitter: 72.52.91.14 ---- Manual Page -- http://php.net/manual/en/function.stripos.php Edit -- https://master.php.net/note/edit/113898 Del: integrated -- https://master.php.net/note/delete/113898/integrated Del: useless -- https://master.php.net/note/delete/113898/useless Del: bad code -- https://master.php.net/note/delete/113898/bad+code Del: spam -- https://master.php.net/note/delete/113898/spam Del: non-english -- https://master.php.net/note/delete/113898/non-english Del: in docs -- https://master.php.net/note/delete/113898/in+docs Del: other reasons-- https://master.php.net/note/delete/113898 Reject -- https://master.php.net/note/reject/113898 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#197935) next »