phpfiddle- Test PHP Online With Server

phpfiddle- Test PHP Online With Server

PhpFiddle provides Web IDE, Web Tools, APIs, Widgets, PHP Libraries, programming resources and execution environment for PHP/MySQL and HTML/CSS/JavaScript online coding. PhpFiddle enables individuals to test PHP code pieces, make, test and download simple applications. Current PhpFiddle version is 3.4.4

PhpFiddle Widgets 2.0

Phpfiddle widgets are HTML/CSS and JavaScript code that embodies UIs and PhpFiddle’s APIs in JSON HTTP reaction, any website pages could freely get to Phpfiddle’s services from copy-paste widgets code.

Widget code and installation

For installing the widget copy-paste following code in the head tag.

<!-- JavaScript libraries of PhpFiddle Widgets -->
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<link type="text/css" href="//phpfiddle.org/js/codemirror5.21.1/lib/codemirror.css" rel="stylesheet">
<link type="text/css" href="//phpfiddle.org/js/codemirror5.21.1/addon/pf/css_set.css" rel="stylesheet">
<script type="text/javascript" src="//phpfiddle.org/js/codemirror5.21.1/lib/codemirror.js"></script>
<script type="text/javascript" src="//phpfiddle.org/js/codemirror5.21.1/mode/pf/allmixed.min.js"></script>
<script type="text/javascript" src="//phpfiddle.org/js/codemirror5.21.1/addon/pf/js_set.min.js"></script>
<script type="text/javascript" src="//phpfiddle.org/js/codemirror5.21.1/addon/pf/js_set_ext.min.js"></script>

Copy-paste following code in the HTML body tag and set widget parameters as needed

<!--	
	Run mixed code widget
	
	Run PHP/MySQL, HTML/CSS and JavaScript code with PhpFiddle services
	
	Widget parameters 
		widget_width_percentage from 25 to 100 in percentage, other with 60 always
		widget_height_pixels from 50 to 650 in pixels, other with 260 always 
		editor_width_percentage from 20 to 80 in percentage, other with 62 always
		eitor_placeholder with a string
	
	Keyboard shortcuts
		F8		Clear
		F9		Run
		Ctrl-Z	Undo
		Ctrl-Y	Redo
		Ctrl-[	Decrease indent ( Shift left )
		Ctrl-]	Increase indent ( Shift right )
		Alt-1	PHP autocomplete 
		Alt-2	JavaScript autocomplete
        Alt-3	MySQL autocomplete 
		Alt-4	jQuery v3.0 autocomplete	
	
	Version 
		2.0
	
	copyright
		Copyright (c) 2012-2017 PhpFiddle.org
	
	License
		http://opensource.org/licenses/MIT  The MIT License (MIT)		
-->
<script src="//phpfiddle.org/deposit/widget_001.php
		?widget_width_percentage=60
		&widget_height_pixels=260
		&editor_width_percentage=62
		&editor_placeholder=Enter PHP/MySQL, HTML/CSS and JavaScript code here..."
	type="text/javascript">
</script>
<div id="phpfiddle_widget_001"></div>

Widget preview

phpfiddle

PHP Libraries

  • PHP core and extension libraries
  • Execution Environment libraries

PHP APIs

PHP APIs are some PHP functions, which only be used with other PHP code

PhpFiddle do not add environment library to files in user id folder (it is $_SERVER[‘EE_ROOT’]/user id/ ) in default, you should use ‘require_once “fiddle_envlib.php”;’ to include environment library to your code before you can use these APIs

string pf_file ( mixed $id [, bool string $new_dependency = FALSE] )

Get real file name from code id for using other code in your current code

Parameter :$id, link id or gist id, an array may be used to assign multiple link id or gist id
$new_dependency, set TRUE when the code that code id pointed was updated

Return: The file name of the string, or empty if failed

Example :

<?php
	// Get a file contained all code from code id : "894-im7" and "gkz-swm"
	$ids = array ( "894-im7", "gkz-swm" );	// Or $ids = "894-im7"; If only one code id
	$file = pf_file ( $ids );
	
	if ($file == '')
	{
		echo "Can't get file name from PhpFiddle code id";
		exit();
	}
	
	include_once $file;
?>

void pf_forward ( string $id [, string $qstr = ”] )

Redirect current page to the execution location of link id or gist id

Parameter :$id, link id or gist id for the code,
$qstr, the query string for the designated file

Return: No value is returned, or FALSE if failure

Example :

<?php
	// redirect without query string
	// $id = "6q4-rum";
	
	// pf_forward( $id );
	
	//redirect with query string
	$id = "6q4-rum";
	$qstr = "param1=data1&param2=data2&param3=data3";
	
	pf_forward( $id, $qstr );
?>

PhpFiddles

There are two different tools available:

PhpFiddle

Visit

phpfiddle

PHPFiddle lite

Visit

phpfiddle

Application entrances

PhpFiddle provides following application entries to execute from address column of browsers

In description “code_id” is a public link id which saved the code on PhpFiddle or a gist id which saved the code on GitHub:gist ( https://gist.github.com/phpfiddle ) by PhpFiddle, link id is made up of ‘-‘ and 6 or 8 characters in lowercase, for example, DFI-q1d, ze5q-kpb9, and gist id is string in 7, 20 or 32 characters defined by GitHub Gist, for example: 3691666, ec165a789941a37e51d8, 271254139b39bf0435895a6eea3f5b5f

PhpFiddle advocates concise and elegant URL format, you do not have to add ‘www.’ to our domain when you visit PhpFiddle

Visit the database tutorial list. And make strong your database concept. click here. wuschools.com is always written about the database concept for the database lover. Ang writes about how database makes your life easy if you are a web site developer.

Leave a Reply

Close Menu