Is there a PHP Sandbox, something like JSFiddle is to JS?
If you are just looking for an online site to play around with PHP code, try
- http://phpfiddle.org/
- http://ideone.com/
- https://codeanywhere.net/
- http://www.tehplayground.com/
- http://sandbox.onlinephpfunctions.com/
- http://codepad.org/
- https://eval.in/
- https://implode.io/ (permits attaching a version of the Laravel framework)
The most sophisticated is:
- http://3v4l.org/
It lets you test your code in all PHP versions starting from PHP4.
If you want something for your local environment, the Runkit extension aims to provide a PHP Sandbox:
Instantiating the Runkit_Sandbox class creates a new thread with its own scope and program stack. Using a set of options passed to the constructor, this environment may be restricted to a subset of what the primary interpreter can do and provide a safer environment for executing user supplied code.
If you dont want to use Runkit but still want a PHP Console on your server, try
- Jordi Boggiano's Blog - PHP Console in Your Browser
- http://github.com/seldaek/php-console
How do I tell if my application is running as a 32-bit or 64-bit application?
if (IntPtr.Size == 8)
{
// 64 bit machine
}
else if (IntPtr.Size == 4)
{
// 32 bit machine
}
Real estate site, trying to only output properties based on type
Based on the PHP code in the fiddle (Which really shouldn't be there since the fiddle is for Javascript), it seems like the problem is that you never use the select_type
given in the URL.
Take a look at this line. This is the first time $select_type
is used.
if (!isset($select_type)) $select_type = "all";
Thus, $select_type
will always be all
.
Instead you should either change it to:
if (!isset($select_type)) $select_type = $_GET['select_type'];
Or just add this line before it:
$select_type = $_GET['select_type'];
Related Topics
Php: Inserting Values from the Form into MySQL
New Limit Within PHP: 1000 Fields Per Post. Does Someone Know, If the Number Can Be Influenced
Will Copy-On-Write Prevent Data Duplication on Arrays
Checking If Array Is Multidimensional or Not
Run Composer with a PHP Script in Browser
What's the Difference Between PHP's Dom and Simplexml Extensions
How to Convert Soap Response to PHP Array
Using PHP Substr() and Strip_Tags() While Retaining Formatting and Without Breaking HTML
Seamless Way to Check If User Likes Page
Remove All the Line Breaks from the HTML Source
The Advantage/Disadvantage Between Global Variables and Function Parameters in PHP
Count Specific Values in Multidimensional Array
How to Access Route, Post, Get etc. Parameters in Zend Framework 2