PHP Tutorials: Name Splitter (Part 1)

Posted by: Admin  :  Category: Php

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

Splits a full name into two seperate variables. Useful for signup forms where you just want to ask the user their full name, and not have two seperate boxes for first and last names.

Linux Cpanel shared hosting: 600 GB disk space, 6 TB bandwidth, free domain, unlimited databases and ftp accounts, web hosting cheap and pro at Hostony

25 Responses to “PHP Tutorials: Name Splitter (Part 1)”

  1. suchal12 Says:

    @phpacademy never mind these selfish persons who do not know how much efforts are involoved in opening a profitable youtube channel and how difficult it is to take time for free tuts or open source programs. they do not believe in hardwork. i hate these type of guys. and great tutorial man i support you in every case. do not get angry on freaks it will waste you energy but will have no effect on them.
    sorry for bad english.

    sorry for bad english .

  2. fize4ever Says:

    Haters gonna hate Alex, you are pure win, and I know how to code basic PHP thanks to you!

  3. 75Mrdanny Says:

    thanks for your time

  4. samiwistler Says:

    PHP gurus

  5. CardMagician10 Says:

    Why can’t you just use explode:
    explode(‘ ‘,’$fullname’)
    And then use a foreach loop to split the the array into variabels?

  6. marloncastrillo Says:

    awesome, keep it up man and don’t pay attention to this idiots who doesn’t appreciate people like you doing this for free!

  7. urbanvideostv Says:

    @phpacademy The tutorials are great bro,It’s helping a lot ,you don’t have to listen to the haters.

  8. dimashur Says:

    Want to learn PHP as fast as possible? All you need to know in one detailed book. The book for the complete beginner and expert as well.
    Only for 39.95$. You won’t find a better guide.
    (replace (dot) with a dot…)

  9. ranger135xp Says:

    @GoRRaNNNNN “”Give a fish to man and he will eat for a day, but learn๏ปฟ him fishing and he will eat whole life…” ;)” I think you better calm down and try tackling the English language before you start any fishing or bad critiquing. Was your brain “turned on” before you wrote that? Ha, sounds like you need phpacademy to make a tutorial on English Language Basics. Rofl

  10. jseddon001 Says:

    don’t forget you can use the list() and explode() functions as well

    list($first_name, $last_name) = explode(‘ ‘, $fullname, 1);

  11. gfloodsie Says:

    I don’t get why some people search for tutorials on php but don’t have the patience to listen and learn something. These are extremely good tutorials and the fact that they are free is a credit to you aswell. If people aren’t interested in watching them then they shouldn’t be searching for them.

  12. VitaminCM Says:

    Cool tutorial. I use XAMPP on my local machine to test things out before I implement them on my production web server.

  13. Samzsite Says:

    not sure if anyone said this but… explode(” “, $fullname);

  14. op4l4 Says:

    My code was removed : I rewrite it :

    $fullname = explode(‘ ‘, $fullname);

    $firstname = $fullname[0];
    $lastname = $fullname[1];


  15. op4l4 Says:

    This is the logical way to do this

  16. mhzujo Says:

    This much simpler:

    $len = strlen($fullname);
    for ($i=0;substr($fullname,$i,1)!=” ” && $i<$len;$i++) {} $firstname = substr($fullname,0,$i); $lastname = substr($fullname,$i);

  17. interrobanging Says:

    Ignore any bad comments phpacademy. Your tutorials are a great help – I even love it when you get things wrong because it helps to see how things can be fixed and the logic behind how it works. Keep up the good work. Rhys

  18. Streetsmagazinetv Says:

    thanks very much for this u are a good teacher question why do u give the $firstname=$firstname I get a littleconfused there..Or does any one know?
    gr ocean

  19. Foaman Says:

    Of course it didn’t work because you said that last name and first name were exactly the same and–Well they aren’t the same, naturally!–, but let’s see how you fix it. ๐Ÿ™‚

  20. Foaman Says:

    I like reading about the multiple styles. It allows me to make a better network of all the data in my head, and it makes it easier for me to think of creative ways to code. Coding can be like an art. I tend to agree with you that nitpicking doesn’t help a whole lot, but it’s not like they’re going to stop. So just enjoy it. – movingsole

  21. ERIKTODX Says:

    Instead of $firstname = $firstname.mb_substr(…..); you could just use $firstname.=mb_subsrt(…..); – there is less code.

    Great video btw.

  22. stunningstylez Says:

    Is everyone really that stupid? He clearly explains there ARE OTHER EASIER WAYS OF DOING THIS. And many of you are questioning the way he is doing it…no s*** there are different codes for the same thing, HE EXPLAINS THAT. Just enjoy, and if you already know how to do it, why are you wasting time watching this tutorial? btw tuleo i know you are just joking, so no shots at you

  23. tuleo554 Says:

    not sure mate, tbh im new to PHP, more a Perl guy

  24. TheKingmidas222 Says:

    lol i was thiking same isnt there word parsing function also?

  25. GrinningSandCat Says:

    It would be interesting to see your code. Bet nothing kills your creativity when it comes to making spaghetti ๐Ÿ˜‰

Leave a Reply