View Poll Results: PHP Most Used Functions
- Voters
- 5. You may not vote on this poll
-
explode
-
file
-
substr_count
-
session_register
-
sprintf
-
strlen
-
implode
-
md5
-
str_replace
-
none of the above
-
May 13th, 2003, 04:04 PM
#1
Thread Starter
Addicted Member
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.
-
May 13th, 2003, 04:54 PM
#2
Stuck in the 80s
I never really pay attention to what my most used function is, so I'll just vote for the one I find most usefull.
-
May 14th, 2003, 08:09 AM
#3
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.
-
May 14th, 2003, 02:31 PM
#4
Thread Starter
Addicted Member
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.
-
May 14th, 2003, 03:35 PM
#5
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.
-
May 14th, 2003, 04:01 PM
#6
Stuck in the 80s
echo and print are not functions, they are language constructs.
-
May 15th, 2003, 11:33 AM
#7
Frenzied Member
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.
-
May 16th, 2003, 05:10 AM
#8
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.
-
May 16th, 2003, 09:08 AM
#9
Frenzied Member
well, not really deprected but goes against the standard. (if you go by that) :P
-
May 17th, 2003, 09:50 AM
#10
Call me immature/destructive mind, but what does the "explode" function do?
-
May 17th, 2003, 10:01 AM
#11
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.
-
May 17th, 2003, 12:36 PM
#12
Frenzied Member
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.
-
May 17th, 2003, 01:19 PM
#13
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.
-
May 17th, 2003, 01:27 PM
#14
Stuck in the 80s
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.
-
May 17th, 2003, 02:07 PM
#15
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.
-
May 17th, 2003, 03:21 PM
#16
Stuck in the 80s
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?
-
May 17th, 2003, 03:33 PM
#17

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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|