Rainrays Profiles
   Login | Registration | What you Want | Free Ads | Tours & Travel India

Home rainrays profile world Aadhaar Card Online Free Marketing Contact Us Online Free Marketing URL Submission Online Free Marketing Tour n Travel Free Ads with rainrays Products Web Directory Pincode India Web Directory Search India Jobs Herbalife Club Online Fm radio Recipes

Custom Search
Plan Your Tour
Best Tours India
 Week End Tours  Week End Tours
 Wildlife tours Wildlife tours
 Honeymoon  Honeymoon Tours
 Religious Tours Religious Tours
 Religious Tours International Tours
 Religious Tours Indian Tours for Overseas

Delhi Agar Jaipur Tour

More Topics...
  Hospitals & clinics in India Hospitals & clinics in India
  Hospitals & clinics in India World Travel Tips
 Kitchen Dictionary Kitchen Dictionary
 Recipes Recipes
 Personality Personality
 Institute/Colleges Institute/Colleges
 Indian Festivals Indian Festivals
 University University
 Restaurant Restaurant
 Districts List in India Districts List in India
 Districts Profile of India Districts Profile of India
 Hotels Hotels
 Love dating and Romance Love dating and Romance
 Baby name list Baby name list
 Jobs by location Jobs by location
 Jobs by Keyword Jobs by Keyword
 Jobs by Function Jobs by Function
 Jobs Part Time Jobs Part Time
 Shayari Shayari
 Place Profile Place Profile
 Business Profiles Business Profiles
 Professional Profiles Professional Profiles
 Rainrays Member Rainrays Member


  Topic » Language » PHP » String
Post By : Rainrays At 2010-05-10 16:15:02

Counts the number of substring occurrences 

php program

function searchtext ($haystack, $needle){
    if (substr_count ($haystack, $needle) == 0){
          echo "No instances were found of this search query";
    } else {
        $startpos = 0;
        $lookagain = true;
       while ($lookagain){
          if ($pos = strpos ($haystack, $needle, $startpos)){
                echo "The search term \"$needle\" was found at position: $pos ";
                $startpos = $pos + 1;
          } else {
                $lookagain = false;
      echo "Your search for \"$needle\" within \"$haystack\" returned a total of \"" . substr_count ($haystack, $needle) . "\"        matches.";
searchtext ("Hello World!","o");

The search term "o" was found at position: 4
The search term "o" was found at position: 7
Your search for "o" within "Hello World!" returned a total of "2" matches.

Refer to Friend

  Rainryas information World

Share Info/View About Profile Or Any Comment

Your Name:* 
Other Topic
District Nashik
कुछ उपयोगी घरेलू प्रयोग, Trick and tips for home – Hindi
Geeta Bhawan Rishikesh
Engineer jobs in India
Rajasthan :: Hotels List
Create Your Profile in Category » String
More on rainrays.com
Top Links : FM Radio | Contact us | About us | Privacy & Policy | Terms & Condition | Extract Email | Submit URL to Search Engine
Net Search : For Cooking | Word Dictionary | Encyclopedia Search | Find Location by MAP | Find a Person | Find Your Shipping | Stock Market | Language Converter
Jobs : Jobs by Location | Part Time Jobs | Jobs by Function | Jobs by Keyword | Jobs Out of india | Jobs Search Engine
Other Links
    Girl baby Names | Boy baby Names | Love dating and Romance | University | Restaurants in India | Hotels in India | Hospitals & clinic
    Coaching Institute | Educational Institution | School/Colleges by Loaction | Recipes | Std Code | PHP | Products | Links
PHP Interview Question

Copyright © 2010 --- All Rights Reserved