Shop Forum More Submit  Join Login
humanList.teardrop.php by photofroggy humanList.teardrop.php by photofroggy
Introducing function humanList();

When looking through a pastebin for a particular channel on dAmn, I found this function made by someone else, and you can see it here. Now when I saw this function I didn't know what it was doing until I looked at the intended outputs, and upon discovering its purpose, I knew that it could be simplified. I took it upon myself to create a revision of the function. This revision can be found here.

So I have a revision which works, but I haven't yet explained what it does yet. The function takes an array of items and returns these items as a string, which is near enough grammatically correct. Examples below.

// This would just return the string itself.
echo humanList("one");

// Here we would get "one and two" in return for our efforts.
echo humanList(array("one", "two"));

// If we get slightly more complicated, we get "one, two and three"
echo humanList(array("one", "two", "three"));

// And for an even more complicated one, we get "one, two, three and four".
echo humanList(array("one", "two", "three", "four"));


Hopefully you can see why this function would be useful. You could call it a "list pretty-printer", but I'm not sure if that's the correct term for it.

So, I eventually get bored, and decide to toy with the layout of the function, and this picture is the result. It contains exactly the same code and it does exactly the same thing, so there's nothing to be worried about. I tried making it look like a teardrop because I've never done anything like this before and I thought it would be easy, but I still had some trouble with positioning certain things.

Thanks for reading, critique is appreciated!

- photofroggy

[EDIT] ~philo23 made the original function!
Add a Comment:
 

The Artist has requested Critique on this Artwork

Please sign up or login to post a critique.

:iconelmfuzz:
elmfuzz Featured By Owner Oct 27, 2008   Photographer
wow, that's cool! i like the way it still retains function
Reply
:iconphotofroggy:
photofroggy Featured By Owner Oct 27, 2008  Hobbyist Artist
Well, I think it has to, or it wouldn't work.
Reply
:iconelmfuzz:
elmfuzz Featured By Owner Oct 27, 2008   Photographer
ah, but you could also do something like that that's just ASCII art
Reply
:iconphotofroggy:
photofroggy Featured By Owner Oct 27, 2008  Hobbyist Artist
Oh right, I see now :slow: Thanks anyway :bucktooth:
Reply
:iconmrslowniko:
MrSlowNiko Featured By Owner Oct 7, 2008  Hobbyist General Artist
I knew PHP was a true Art ;)
Reply
:iconphotofroggy:
photofroggy Featured By Owner Oct 8, 2008  Hobbyist Artist
:bow:
Reply
:iconmrslowniko:
MrSlowNiko Featured By Owner Oct 8, 2008  Hobbyist General Artist
:)
Reply
:iconwhitepowa:
whitepowa Featured By Owner Jul 19, 2008
goddamn!! lol, it truly is an art.
Reply
:iconphotofroggy:
photofroggy Featured By Owner Jul 20, 2008  Hobbyist Artist
Thanks :)
Reply
:iconwhitepowa:
whitepowa Featured By Owner Jul 21, 2008
hmmhmm
Reply
Add a Comment:
 
×

Featured in Collections

Other Favs by Thorero




Details

Submitted on
June 27, 2008
Image Size
10.3 KB
Resolution
217×272
Link
Thumb

Stats

Views
2,372
Favourites
9 (who?)
Comments
10
Downloads
88