₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,331,014 members, 8,448,232 topics. Date: Monday, 20 July 2026 at 02:56 AM

Toggle theme

Can You Solve This PHP Problem?? - Webmasters - Nairaland

Nairaland ForumScience/TechnologyWebmastersCan You Solve This PHP Problem?? (1473 Views)

1 Reply (Go Down)

Can You Solve This PHP Problem?? by emmyvet(op): 3:04pm On Dec 02, 2014
Hello,
Please am having a little problem on my php $,

I have;
$ID = "1347";
Please is it possible for me to extract the first digit of the $ID which is 1?
And put it into another $, with the name $firstdigit,
that is $firstdigit = "1";//a code that can help me pull the ist digit in the $ID

if its possible, can someone please give me a clue?
Re: Can You Solve This PHP Problem?? by destino24(m): 3:28pm On Dec 02, 2014
$ID = "1347";
$firstdigit = substr($ID,0,1); //new variable takes in characters from position 0 to 1

might work, check it out
Re: Can You Solve This PHP Problem?? by emmyvet(op): 3:39pm On Dec 02, 2014
destino24:
$ID = "1347";
$firstdigit = substr($ID,0,1); //new variable takes in characters from position 0 to 1

might work, check it out
Oh thanks bro!
I Forgot the inbuilt fxn. grin
Re: Can You Solve This PHP Problem?? by destino24(m): 3:44pm On Dec 02, 2014
emmyvet:
Oh thanks bro!
I Forgot the inbuilt fxn. grin
totally cool, happens all the time. Had to check it up to get the answer
Re: Can You Solve This PHP Problem?? by emmyvet(op): 3:50pm On Dec 02, 2014
destino24:
totally cool, happens all the time. Had to check it up to get the answer
Lol,
That's why I cant do without my internet.
Re: Can You Solve This PHP Problem?? by destino24(m): 3:56pm On Dec 02, 2014
emmyvet:
Lol,
That's why I cant do without my internet.
so you are located at abakpa and you run a web development e-firm?
Re: Can You Solve This PHP Problem?? by emmyvet(op): 3:59pm On Dec 02, 2014
destino24:
so you are located at abakpa and you run a web development e-firm?
Yes you are correct!
Are you in Enugu?
Re: Can You Solve This PHP Problem?? by destino24(m): 4:02pm On Dec 02, 2014
emmyvet:
Yes you are correct!
Are you in Enugu?
i stay at abakpa too
Re: Can You Solve This PHP Problem?? by emmyvet(op): 4:06pm On Dec 02, 2014
destino24:
i stay at abakpa too
Good to see you here!

Are you available on Whatsapp or bbm? contacts on my signature
Re: Can You Solve This PHP Problem?? by destino24(m): 4:15pm On Dec 02, 2014
emmyvet:
Good to see you here!

Are you available on Whatsapp or bbm? contacts on my signature
sent you a message via whatsapp
Re: Can You Solve This PHP Problem?? by dwebdesign(m): 4:17pm On Dec 02, 2014
You are storing integer into a variable. You don't put open and close marks. Except you want to turn the integer into a string.
Hope this help?.

Contact:

Mobile: 08133884165

What's app: 08133884165

BBM: 2BB63350
Re: Can You Solve This PHP Problem?? by emmyvet(op): 4:25pm On Dec 02, 2014
dwebdesign:
You are storing integer into a variable. You don't put open and close marks. Except you want to turn the integer into a string.
Hope this help?.

Contact:

Mobile: 08133884165

What's app: 08133884165

BBM: 2BB63350
The problem has been solved shaa,
Am just trying to pick a digit from my $, but forgetting the inbuilt function substr().
Thanks!
Re: Can You Solve This PHP Problem?? by dwebdesign(m): 8:46pm On Dec 02, 2014
You are welcome. Happy coding!
Re: Can You Solve This PHP Problem?? by emmyvet(op): 10:02pm On Dec 04, 2014
dwebdesign:
You are welcome. Happy coding!
grin
Re: Can You Solve This PHP Problem?? by adenijiayo(m): 10:22am On Dec 05, 2014
$id = 1347;
$firstdigit = $id[0];
echo $firstdigit.
1 Reply

Help To Correct This Php Mailer Code[php] - Problem! Object Oriented. Accessing Variable In Function A In Function BPhp Problem: Retrieving Images And Display In Horizontally Format.234

How To Make Content Ad Ads Appear In The Middle Of Blog PostHave You Got Ctb Website That You Will Like To Sell.Help I'm Having Adsense Issues