#44010 [Opn->Bgs]: Function: strstr() and stristr()

From: Date: Fri, 01 Feb 2008 10:26:05 +0000
Subject: #44010 [Opn->Bgs]: Function: strstr() and stristr()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-121858@lists.php.net to get a copy of this message
ID: 44010 Updated by: felipe@php.net Reported By: diemuzi at gmail dot com -Status: Open +Status: Bogus Bug Type: Strings related Operating System: Archlinux PHP Version: 5.2.5 New Comment: Documentation says on changelog section: - 6.0.0 Added the before_needle parameter. And the new parameter is optional, the doc shows it wrong. I'll fix it. Previous Comments: ------------------------------------------------------------------------ [2008-02-01 08:30:05] rabbi at naglfar dot hu Until then use this: $user = substr ($email, 0, strpos ($email, "@")); ------------------------------------------------------------------------ [2008-02-01 08:23:18] rabbi at naglfar dot hu Or it's will be added in the 6.0.0 version... ------------------------------------------------------------------------ [2008-02-01 01:52:15] diemuzi at gmail dot com Description: ------------ Using these two functions strstr() and stristr(). The bug occurs only while using "true" when cutting characters from a string to return the value before the cut. Reproduce code: --------------- $email = 'name@example.com'; $domain = strstr($email, '@', true); echo $domain; Expected result: ---------------- name Actual result: -------------- Warning: Wrong parameter count for strstr() ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44010&edit=1

« previous php.bugs (#121858) next »