This challenge is related to the PHP language. Note that challenges that require the answers to be in a specific language are generally discouraged.

learn more… | top users | synonyms

-2
votes
1answer
129 views

Creating a colour chart in PHP will all colours [duplicate]

Now, before we begin, this has already been done here. But!, there are no PHP answers. With that in mind, my CodeGolf is thus: create a program to show all the colours in the html CSS spectrum using ...
3
votes
2answers
671 views

Shortest Code to Translate a PHP array

NOTE: This question was migrated from http://stackoverflow.com/q/27134588/1442685 PHP QUESTION Almost purely out of curiousity, how can I take an array like this: array( 'fruit' => 'banana', ...
-4
votes
1answer
5k views

Shortest way to generate UUID's version 3,4 and 5 in php

I have this function to generate UUID's: function uuid($v=4,$d=null,$s=false)//$v-> version|$data-> data for version 3 and 5|$s-> add salt and pepper { switch($v.($x='')) { ...
1
vote
1answer
618 views

Compressing a DNA-like string [closed]

my app is multiple choice test, where for each question the response results in a 4 letter string "eg" GTAC or ATGC or CATG, etc. There are always just 24 questions. so the final result is something ...
12
votes
15answers
1k views

10 PRINT CHR$(205.5+RND(1)); : GOTO 10 in PHP (or anything else, for that matter)

Just had a 'spirited' conversation with a co-worker about the succinctness of the following BASIC statement: 10 PRINT CHR$(205.5+RND(1)); : GOTO 10 It's the title of this book, and will simply ...
7
votes
2answers
874 views

PHP golfing tips: Reading/writing files and the CLI

I have been participating in a number of PHP code golf challenges recently and some of the techniques that are used to read data from a file such as fopen() and fread() or file_get_contents() really ...
18
votes
9answers
2k views

Tips for golfing in PHP

What general tips do you have for golfing in PHP? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to PHP (e.g. "remove comments" is not ...
5
votes
2answers
790 views

“list comprehension” in php.

PHP has closures, let's play around with them. I have some arrays similar to, $wannabelist = array (1, 2, 3, 4, 5, 6). I want to do this: compr( expression($params), $wannabelist, $wannabilist2 ...