CKEditor – Get Content

<textarea id=”content_id”></textarea>

<input type=”button” value=”Clickme” onclick=”showData()” />

<script type=”text/javascript”>

function showData(){

var sourceText = CKEDITOR.instances[“content_id”].getData();




PHP – Accessing Google Translate with CURL

save the script below to gtproxy.php

change the langpair query string value to your desired value, here I use id (indonesian) to en (english)


then test using content as query string to store text which will be translated

eg: gtproxy.php?content=percobaan


function replace_unicode_escape_sequence($match) {
return mb_convert_encoding(pack(‘H*’, $match[1]), ‘UTF-8’, ‘UCS-2BE’);

$query  = trim($_GET[‘content’]);
$query  = urlencode($query);

$ch     = curl_init();
curl_setopt($ch, CURLOPT_URL, “$query&#8221;);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$contents = curl_exec ($ch);

curl_close ($ch);

$str = preg_replace_callback(‘/\\\\u([0-9a-f]{4})/i’, ‘replace_unicode_escape_sequence’, $contents);

echo substr($str, 57, -19);


Facebook – Specify Article Picture When Visitor Click Like Button

<meta property="og:title" content="This is my title" />
<meta property="og:type" content="activity" />
<meta property="og:url" content="" />
<meta property="og:image" content="" />
<meta property="og:site_name" content="I'm on Facebook!" />
<meta property="og:description" content="Hello World!" />

use: <meta property="og:image" content="" />

PHP – Get Youtube Video Title (based on supplied Video ID)

$video_id = ’48J_DIZBNyE’;
$content = file_get_contents(“; . $video_id);
parse_str($content, $ytarr);
echo $ytarr[‘title’] . ‘<hr>’ ; // title
you can also use this way
$video_id = ’48J_DIZBNyE’;
$video_info = simplexml_load_file(‘;.$video_id.’?v=1′);
echo $video_info->title . ‘<hr>’; // title
echo $video_info->content; // description