Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in PHP only
Search
Advanced Search
Forums
Product Launch
Updates
Today's Posts
Member List
Calendar
Home
Forum
Topic
PHP
Help on Registration Script
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
loverboy
New Member
Join Date:
Jul 2011
Posts:
2
#1
Help on Registration Script
Jul 5 '11, 05:00 PM
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
Join Date:
Jan 2007
Posts:
12517
#2
Jul 5 '11, 05:24 PM
You can use the
substr() function
to get the first/last characters and see if it's a period.
Comment
Post
Cancel
Rabbit
Recognized Expert
MVP
Join Date:
Jan 2007
Posts:
12517
#3
Jul 5 '11, 06:44 PM
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
Post
Cancel
Darker
New Member
Join Date:
Jul 2011
Posts:
2
#4
Jul 6 '11, 12:57 PM
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
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment