Comunitatea PHP Romania
 

 
strstr

strstr

(PHP 3, PHP 4 , PHP 5)

strstr -- Find first occurrence of a string

Description

string strstr ( string haystack, string needle)

Returns part of haystack string from the first occurrence of needle to the end of haystack.

If needle is not found, returns FALSE.

If needle is not a string, it is converted to an integer and applied as the ordinal value of a character.

Notã: This function is case-sensitive. For case-insensitive searches, use stristr().

Exemplu 1. strstr() example

<?php
$email
= 'user@example.com';
$domain = strstr($email, '@');
echo
$domain; // prints @example.com
?>

Notã: If you only want to determine if a particular needle occurs within haystack, use the faster and less memory intensive function strpos() instead.

See also ereg(), preg_match(), stristr(), strpos(), strrchr(), and substr().

Ultimele discutii in forum RSS Forum

Ultimele articole Ultimele articole

Top membri

Pirahna Pirahna
la birou
carco carco
Bucuresti
Birkoff Birkoff
Bucuresti
mihaitha mihaitha
Sibiu
Mascka Mascka
Braila
gabysolomon gabysolomon
Bacau
whooper whooper
Toronto ON
raul_ raul_
dechim dechim
Drobeta Turnu Severin
Amenthes Amenthes

Newsletter


Email:
 inscriere
 renuntare
 
 Arhiva newsletter

Parteneriat

Copyright © 2001-2008 PHP Romania Add PHPRomania to Google Add PHPRomania to Del.icio.us Add PHPRomania to Stumbleupon Add PHPRomania to Yahoo! Add PHPRomania to Digg Add PHPRomania to Blink Remortgages | Dubai Property | Credit Counseling | Mortgage Loans | Business Credit Cards
Ads: Partener Way2Web Nework: gazduire web | inregistrare domenii | web design | imobiliare | web hosting
Powered by Simplis