Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] alternatywa strstr i jego 3 parametru
mefjiu
post
Post #1





Grupa: Zarejestrowani
Postów: 313
Pomógł: 5
Dołączył: 22.03.2005

Ostrzeżenie: (0%)
-----


Potrzebuje funkcję która która odetnę ciąg od 1 napotkanego znaku ale w lewo

Funkcja strstr() posiada optymalny 3 parametr
before_needle

If TRUE (the default is FALSE), strstr() returns the part of the haystack before the first occurence of the needle .

ale problem jest taki że:
5.3.0 Added the optional parameter before_needle .

jest coś innego ?

muszę uzyskać dosłownie coś identycznego
  1. <?php
  2. $user = strstr($email, '@', true);
  3. echo $user; // prints name
  4. ?>

ale odrazu pisze że nie jest mi to potrzebne do walidacji adresu email.

Proszę o wszelką pomoc

Ten post edytował mefjiu 16.04.2008, 11:29:44
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 05:09