Warning: This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE. Please read the section on Booleans for more information. Use the === operator for testing the return value of this function.
ref
2) I've seen it sometimes return sec-websocket-accept so must be used stripos instead of strpos for case-insensitive
1) Must used
=== false
instead of!
forstrpos
.2) I've seen it sometimes return
sec-websocket-accept
so must be usedstripos
instead ofstrpos
for case-insensitivehttps://github.com/paragi/PHP-websocket-client/blob/cefdf416d96d01733bd6e62b9ba0ddbbe5888e96/websocket_client.php#L117