Help on Registration Script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • loverboy
    New Member
    • Jul 2011
    • 2

    Help on Registration Script

    How to detect strings character location !
    I want to get the last word of a string or a variable..
    Last edited by Niheel; Jul 5 '11, 07:19 PM. Reason: Please post a clear question with all details.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    You can use the substr() function to get the first/last characters and see if it's a period.

    Comment

    • Rabbit
      Recognized Expert MVP
      • Jan 2007
      • 12517

      #3
      It's the substr() function. I linked you to the PHP page for it in my previous post.
      Code:
      substr(strVariable, 1, 1)
      That will get the first character of the string variable. You can use that to check if it's a period.

      Comment

      • Darker
        New Member
        • Jul 2011
        • 2

        #4
        If you want to get the last word, it is:
        Code:
        substr($text, strrpos($text," "));
        Last edited by Darker; Jul 6 '11, 12:58 PM. Reason: Wrong argument sequence for strrpos.

        Comment

        Working...