#1

  1. Join Date
    Sep 2013
    Location
    Lahore, Pakistan
    Posts
    74
    Rep Power
    1

    Smile Explode Function Error : Basics


    Hi Friends
    I am back.

    I am getting error in this code.
    but I think code is correct.

    PHP Code:
    <?php
                        $name1 
    "Noor Ali But";
                        
    $name2 "But";
                        echo 
    explode(" ",$name1);
                        
    var_dump($name1)
                    
    ?>
    Please help me
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,405
    Rep Power
    594
    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.
  4. #3

  5. Join Date
    Sep 2013
    Location
    Lahore, Pakistan
    Posts
    74
    Rep Power
    1

    Talking amazing


    Originally Posted by gw1500se
    We are not clairvoyant. What is the error?
    I did not know what is "clairvoyant"?

    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.
  6. #4

  7. Join Date
    Sep 2013
    Location
    Lahore, Pakistan
    Posts
    74
    Rep Power
    1

    Smile Found Error


    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

    PHP Code:
    <?php
                        $name1 
    "Samee Ullah Feroz";
                        
    $name2 "Feroz";
                        
    $name3 explode(" ",$name1);
                        
    var_dump($name3);
    ?>
  8. #5
  9. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,957
    Rep Power
    1046
    Hi,

    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:

    Code:
    Notice: Array to string conversion
    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?"

    Comments on this post

    • dmittner disagrees : You're not this dense. You know exactly what he meant, especially after his follow-up post.
    • paulh1983 agrees : i agree with Jacques, it doesn't matter if we know what the error is or not. the person asking for help SHOULD tell us the problem not make us guess!
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  10. #6

  11. Join Date
    Sep 2013
    Location
    Lahore, Pakistan
    Posts
    74
    Rep Power
    1
    Originally Posted by Jacques1
    Hi,

    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:
    sorry sir I have notified my error. and also solution.

IMN logo majestic logo threadwatch logo seochat tools logo