SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2005
    Location
    Earth
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    count of the elements

    hi,

    all

    one very basic question??

    how should i count the particular element in a string??

    for example

    $content="Mr.Bush, is the President of U.S."

    in the above string i want to count "." so how should i proceed??


    regards

    amit

  2. #2
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    echo substr_count($content, '.');


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •