CKEditor Sample — Creating CKEditor Instances

This sample shows how to create a CKEditor instance with PHP.

<?php
include_once "ckeditor/ckeditor.php";

// Create a class instance.
$CKEditor = new CKEditor();

// Path to the CKEditor directory.
$CKEditor->basePath = '/ckeditor/';

// Create a textarea element and attach CKEditor to it.
$CKEditor->editor("textarea_id", "This is some sample text");
?>

Note that textarea_id in the code above is the id and name attribute of the <textarea> element that will be created.