Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,151,014 members, 7,810,809 topics. Date: Saturday, 27 April 2024 at 03:53 PM

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

Nairaland Forum / Science/Technology / Webmasters / Can You Solve This PHP Problem?? (1270 Views)

Help To Correct This Php Mailer Code / [php] - Problem! Object Oriented. Accessing Variable In Function A In Function B / Php Problem: Retrieving Images And Display In Horizontally Format. (2) (3) (4)

(1) (Reply) (Go Down)

Can You Solve This PHP Problem?? by emmyvet(m): 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(m): 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(m): 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(m): 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(m): 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

1 Like

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(m): 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!

1 Like

Re: Can You Solve This PHP Problem?? by dwebdesign(m): 8:46pm On Dec 02, 2014
You are welcome. Happy coding!

1 Like

Re: Can You Solve This PHP Problem?? by emmyvet(m): 10:02pm On Dec 04, 2014
dwebdesign:
You are welcome. Happy coding!
grin

1 Like

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)

Open And Verify Paypal Accounts Using Bank Accounts / Google Adsense / Verified Nigeria And US Adsense Accounts For Sale.

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 13
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.