Random Echo??????
Moderator: General Moderators
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
-
malcolmboston
- DevNet Resident
- Posts: 1826
- Joined: Tue Nov 18, 2003 1:09 pm
- Location: Middlesbrough, UK
note to davy:
this is NOT the way to get help
as it clearly states here at least first have a go at writing it yourself and at least post the code so people can tell you whats wrong
this is NOT the way to get help
as it clearly states here at least first have a go at writing it yourself and at least post the code so people can tell you whats wrong
Wow... You people act as if he's asking for a 2000 line application... Here, took me like half a second to do it. Opening my browser took longer.
It's not like people can only learn from writing it themself. Infact the majority of the things I now know are from looking at other people's examples. Just because you learned the "hard" way doesn't mean he has to.[/b]
Code: Select all
<?php
$random_array = array("blue", "yellow", "green");
shuffle($random_array);
echo $random_array['0'];
?>Exactly, i will agree 110%. How I learned was i grabbed a bunch of scripts from evilwalrus.com and took the functions I didnt understand to php.net n examined them..Drachlen wrote:It's not like people can only learn from writing it themself. Infact the majority of the things I now know are from looking at other people's examples.
Excellent
and yeah, the code he was asking for wasnt hard at all. but when someone starts a post out with:
"please will someone please tell me how to make a php do a random echo" that tends to put peoples hearts in the wrong places, lol.
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
Looking at other people's examples is Perfectly fine. There is nothing wrong with that. But asking for someone to write it for you, is totally different. Atleast look something up, try things on your own, or your never going to get it. Of course we could've written it for him, but he probably doesn't know anything about arrays and has no idea what the shuffle() function does. And he probably wont know, becuase all he did was copy your code, and didn't learn anything...
-
malcolmboston
- DevNet Resident
- Posts: 1826
- Joined: Tue Nov 18, 2003 1:09 pm
- Location: Middlesbrough, UK
i would of been perfectly happy to write the application / script out for him but he isnt paying so why should i?
if that was the general concensus across these boards none of us would get contracts and i wouldnt have a job
if you want scripts go to evilwalrus / hotscripts, but if you come on here i personally expect not to see in the coding form especially please write this script out for me
isnt the coding forum for help on your own scripts!?
if that was the general concensus across these boards none of us would get contracts and i wouldnt have a job
if you want scripts go to evilwalrus / hotscripts, but if you come on here i personally expect not to see in the coding form especially please write this script out for me
isnt the coding forum for help on your own scripts!?
Not to turn this thread into a long-winded discussion about how to best help people and how not to, but when I was first learning I had no idea how to read and interpret the PHP manual. So, when people pointed me there I was overwhelmed by the amount of information. I didn't know where to begin to look for answers.
It was when I took other people's code and broke it down piece-by-piece that I began to get a grasp on how things were done. Particularly arrays...I don't know why, but I had the toughest time getting my head around how to use them properly.
Anyway, no, this forum isn't for getting custom scripts. But, it has provided me with a TON of great guidance and very often some script work that completely cleared things up for me. The benefit back to the forum is that I can now come in here and help people with what I know.
Cheesy, metaphorical circle, I know, I know. Just my two cents...
Okay, I'll shut up now.
It was when I took other people's code and broke it down piece-by-piece that I began to get a grasp on how things were done. Particularly arrays...I don't know why, but I had the toughest time getting my head around how to use them properly.
Anyway, no, this forum isn't for getting custom scripts. But, it has provided me with a TON of great guidance and very often some script work that completely cleared things up for me. The benefit back to the forum is that I can now come in here and help people with what I know.
Cheesy, metaphorical circle, I know, I know. Just my two cents...
Okay, I'll shut up now.
as someone pointed out already (i'm to lazy to find the name):
theres a difference between having someone write the code for you to
a.) Just copy n paste it
b.) break it down (as said by me and otheres aboard) to learn with it (like taking the functions to the php manual and doing your homework)
If your a copy n paste, slam bam, your only good for that and when the time comes for you need to imply the method at hand, you'll be back in the same empty dark corner in which you last left off.
If your b, well I hope you understood something from the example and you just added one more "key" to your knowledge bank
farewell
theres a difference between having someone write the code for you to
a.) Just copy n paste it
b.) break it down (as said by me and otheres aboard) to learn with it (like taking the functions to the php manual and doing your homework)
If your a copy n paste, slam bam, your only good for that and when the time comes for you need to imply the method at hand, you'll be back in the same empty dark corner in which you last left off.
If your b, well I hope you understood something from the example and you just added one more "key" to your knowledge bank
farewell
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
Ok going off topic from the original post but rather than saying simply look at php.net it would be useful to narrow down the search requirements to "look at php.net and the function shuffle".
Helps the person but enables him/her to learn. After all php.net has a large number of functions if you have no idea of a function name.
Helps the person but enables him/her to learn. After all php.net has a large number of functions if you have no idea of a function name.
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
yeah i agree, but i would only do that, IF they didn't beg for it, or they had at least tried something logical and looked up a few functions or searched for similar scripts....
But in this case, i could tell he hadn't tried to even look for a script or look for information regarding his question...
But in this case, i could tell he hadn't tried to even look for a script or look for information regarding his question...