This challenge is intended to utilize the PHP language as a means of solving a problem. However, language-specific challenges are generally discouraged on CG.
6
votes
15answers
653 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 ...
-2
votes
1answer
302 views
Generate an ASCII circle in PHP [closed]
Write a PHP script which will echo a circle that consists of # characters.
3
votes
2answers
263 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 ...
0
votes
0answers
57 views
how to include a file from included file that is located in other directory [closed]
I have a script a.php that includes script b.php located in dir/b.php (include 'dir/b.php';)
In the b.php I'm including c.php (include 'c.php';)
How to do that so that whenever I'm running a.php or ...
5
votes
5answers
704 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
252 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
404 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 ...