Use PHP to find and replace html element content with a given classname within a document
I am working on a light-weight inline content editor for my site. Similar to [CushyCMS][1] or [SurrealCMS][2], the 'editable' elements of my page are defined with a `class="editable"`.

I would like to pass 2 variables to php:
    
`$page` The document to be written to (eg. '/path/index.html')

`$json` A json string: `{"0":"First Content","1":"Second Content","2":"Third Content"}` where the key is the index of all elements with `class="editable"` and the value is each element's innerHTML.

In PHP, how can I open `$page` and find/replace `class="editable"` elements?

    $page = $_POST['page'];
    $json = $_POST['json'];
    
    // I'm new to PHP
    
    echo ('Success');




  [1]: http://cushycms.com/
  [2]: http://surrealcms.com/
Use PHP to find and replace html element content with a given classname within a document
===

I am working on a light-weight inline content editor for my site. Similar to [CushyCMS][1] or [SurrealCMS][2], the 'editable' elements of my page are defined with a `class="editable"`.

I would like to pass 2 variables to php:
    
`$page` The document to be written to (eg. '/path/index.html')

`$json` A json string: `{"0":"First Content","1":"Second Content","2":"Third Content"}` where the key is the index of all elements with `class="editable"` and the value is each element's innerHTML.

In PHP, how can I open `$page` and find/replace `class="editable"` elements?

    $page = $_POST['page'];
    $json = $_POST['json'];
    
    // I'm new to PHP
    
    echo ('Success');




  [1]: http://cushycms.com/
  [2]: http://surrealcms.com/