September 30th, 2013, 01:54 PM
Explode Function Error : Basics
I am back.
I am getting error in this code.
but I think code is correct.
Please help me
$name1 = "Noor Ali But";
$name2 = "But";
echo explode(" ",$name1);
September 30th, 2013, 01:56 PM
We are not clairvoyant. What is the error?
There are 10 kinds of people in the world. Those that understand binary and those that don't.
September 30th, 2013, 04:16 PM
I did not know what is "clairvoyant"?
Originally Posted by gw1500se
I search on google and ; it is french word, english mean is : Clear
friend always try to speak full english. don't mix this language.
September 30th, 2013, 04:19 PM
I have found Error myself.
but I am amazed
@gw1500se Does not know explode() function logic completely.
May be you know, but now i made you confuse.
Correct code is
$name1 = "Samee Ullah Feroz";
$name2 = "Feroz";
$name3 = explode(" ",$name1);
September 30th, 2013, 04:46 PM
I have no idea what "error" you got (you still didn't tell us), but there is no error in your code. What I get when I run this is a notice:
This warns you that your code may not work as expected. When you echo an array, all you get is the word "Array". Since that's not very useful, PHP points out this possible error and gives you the chance to correct it. That doesn't mean the code is wrong. It's more like: "Are you sure you wanna do this?"
Notice: Array to string conversion
Comments on this post
October 2nd, 2013, 01:36 PM
sorry sir I have notified my error. and also solution.
Originally Posted by Jacques1