View Poll Results: PHP Most Used Functions

Voters
5. You may not vote on this poll
  • explode

    1 20.00%
  • file

    0 0%
  • substr_count

    0 0%
  • session_register

    0 0%
  • sprintf

    0 0%
  • strlen

    0 0%
  • implode

    0 0%
  • md5

    1 20.00%
  • str_replace

    2 40.00%
  • none of the above

    1 20.00%
Results 1 to 17 of 17

Thread: Most Popular Functions

  1. #1

    Thread Starter
    Addicted Member TheGoldenShogun's Avatar
    Join Date
    Mar 2001
    Location
    VA/MD... anywhere around the beltway
    Posts
    236

    Cool Most Popular Functions

    here we go, I don't know if this is a good poll or not but I was just curious to find out what is your most used php function (non-db). we all can say mysql_query or something like that (depending on your db of choice) but what regular function to you pretty much plan your code around? my vote is for explode, I couldn't live without that function.

    oh yeah, if you got something that aint up there, yell at me and let me know.
    Last edited by TheGoldenShogun; May 13th, 2003 at 04:12 PM.

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    I never really pay attention to what my most used function is, so I'll just vote for the one I find most usefull.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    echo and print...

    I voted str_replace too.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4

    Thread Starter
    Addicted Member TheGoldenShogun's Avatar
    Join Date
    Mar 2001
    Location
    VA/MD... anywhere around the beltway
    Posts
    236
    i was thinking about adding echo and print but those are sort of required for any php program to run and display information so of course those are the most commonly used. I'm asking other than those functions echo, print and the db functions, what do you most commonly use.

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Actually not:
    PHP Code:
    <?php
    $myvar 
    "<strong>Hello, World!</strong>";
    ?>

    <?= $myvar ?>
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  6. #6
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    echo and print are not functions, they are language constructs.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  7. #7
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    Originally posted by CornedBee
    Actually not:
    PHP Code:
    <?php
    $myvar 
    "<strong>Hello, World!</strong>";
    ?>

    <?= $myvar ?>
    and yes, the = sign is shorthand for echo, and you are not suppose to use that as well as it is deprecated

    This short syntax only works with the short_open_tag configuration setting enabled.
    Last edited by phpman; May 15th, 2003 at 11:38 AM.

  8. #8
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Since when deprecated?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  9. #9
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    well, not really deprected but goes against the standard. (if you go by that) :P

  10. #10
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Call me immature/destructive mind, but what does the "explode" function do?

  11. #11
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    It splits a string into an array of substrings.
    i.e. it does the opposite of implode/join.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  12. #12
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    also GoldenShogun, session_register shouldn't even be in that list, it is deprecated and shouldn't be used.

    also I have never used substr_count or sprintf, printf a few times but no need to. and hardly ever use implode.

    you don't even have the most common up there.

    addslashes and stripslashes and htmlspecialchars are the most popular. well at least they better be in yours if you don't want hackers into your system.

  13. #13
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    htmlentities and nl2br
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  14. #14
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Originally posted by CornedBee
    htmlentities and nl2br
    I know nl2br() exists and I know what it does. But for the life of me, I always forget about it and use str_replace()...

    So as soon as I can remember to use it, it'll probably be at the top of my list.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  15. #15
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Do you at least replace to "<br />"?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  16. #16
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Originally posted by CornedBee
    Do you at least replace to "<br />"?
    No. If I am producing a webpage in HTML 4.01, why should I use XHTML standards?
    My evil laugh has a squeak in it.

    kristopherwilson.com

  17. #17
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594


    Go for XHTML then...
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width