Can You Solve This PHP Problem?? - Webmasters - Nairaland
Nairaland Forum › Science/Technology › Webmasters › Can You Solve This PHP Problem?? (1447 Views)
| 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:Oh thanks bro! I Forgot the inbuilt fxn. ![]() |
| Re: Can You Solve This PHP Problem?? by destino24(m): 3:44pm On Dec 02, 2014 |
emmyvet: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: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: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: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:i stay at abakpa too |
| Re: Can You Solve This PHP Problem?? by emmyvet(op): 4:06pm On Dec 02, 2014 |
destino24: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: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: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: ![]() |
| Re: Can You Solve This PHP Problem?? by adenijiayo(m): 10:22am On Dec 05, 2014 |
$id = 1347; $firstdigit = $id[0]; echo $firstdigit. |
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
Traffic Services For Bloggers • Buy A Non Hosted Google Adsense For 2k • Seun, Why Does Nairaland Change Caps To Lower In Titles?
