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

-4
votes
1answer
400 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
votes
1answer
293 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 ...
9
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 ...
4
votes
2answers
466 views

PHP Codegolf: Reading/writing files and the CLI

I have been participating in a number of PHP codegolf 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 ...
10
votes
8answers
1k 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 ...
1
vote
1answer
333 views

[Highly theoretical] How to generate the biggest output with the shortest code? [closed]

I brought this question from SO where I was told to ask it here. ======== I have a highly theoretical question. What is the shortest amount of code to generate the biggest output? For example: ...
4
votes
2answers
523 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 ...