Register on the forum now to remove ALL ads + popups + get access to tons of hidden content for members only!

Go Back   Site Owners Forums - Webmaster Forums > Web Programming > Programming General > PHP / mySQL

Notices


Reply
 
Thread Tools Rate Thread Display Modes
Old 03-10-2017, 07:10 AM   #1
michalsemen
Registered User
 
Join Date: May 2011
Posts: 125
Get First Character of String in PHP

There are three ways to get first character of a string in PHP.

1: By using array index position $res = $currency_value[0]; where $currency_value is holding string.

2: By using built-in PHP function substr() i.e $res = substr($currency_value,0,1);

3: By using built-in PHP function mb_substr() i.e $res = mb_substr($currency_value,0,1)

mb_substr() function is used when programmer is dealing with multibyte UTF8 characters.

Find a video here in which it has been explained clearly that how you can get first character of a string in PHP.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
michalsemen is offline   Reply With Quote

Old 03-13-2017, 03:24 PM   #2
riyadh
Registered User
 
Join Date: Dec 2016
Posts: 11
good job ! thanks
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Webmaster of
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
riyadh is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP introduction stevepatton PHP / mySQL 42 Yesterday 07:49 AM
Importance of Php Development for Web Development tech.biztech Programming General 18 10-23-2017 03:42 AM
Trimming a String with rtrim() chinmay.sahoo PHP / mySQL 0 06-01-2016 03:47 AM
PHP: Explode A String With Multiple Delimiters. noahwilson PHP / mySQL 1 09-26-2013 01:09 PM
PHP project training in ahmedabad, live project training in php ahmedabad anantitsolution Post your ad here 1 07-16-2013 08:42 PM


All times are GMT -7. The time now is 03:11 PM.


Powered by vBulletin Copyright © 2013 vBulletin Solutions, Inc.