<head> <?php $link = peb_connect("cat@food", "abc"); if (!$link) { // die('Could not connect: ' . peb_error()); Header("Location: http://site1.local/404.php"); } $msg = peb_encode("[~s]", array(array("hello"))); //The sender must include a reply address. use ~p to format a link identifier to a valid Erlang pid. $result = peb_rpc("server", "tags_finland", $msg, $link); $rs = peb_decode($result); $msgS = call_user_func_array('array_merge', $rs); if (count($msgS) > 1) { $tags = $msgS; $resultL = peb_rpc("server", "likes_finland", $msg, $link); $rsL = peb_decode($resultL); $likes = $rsL[0]; } else { Header("Location: http://site1.local/404.php"); } peb_close($link); ?> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Loading Bootstrap --> <link href="../../dist/css/vendor/bootstrap.min.css" rel="stylesheet">
public function merge($expire) { $x = peb_encode("[~i]", array(array($expire))); $result = peb_rpc("phpcask", "merge", $x, $this->link); return peb_decode($result); }
//echo '<br/>'; $s = $msg[1]; //print_r($s); //echo '<br/>'; $th = $msg[2]; //print_r($th); //echo '<br/>'; echo '<br/>'; } if (count($msg) < 2) { Header("Location: http://site1.local/404.php"); //echo'if(count($msg)<2)'; } $msg2 = peb_encode("[~s]", array(array($word2))); $result2 = peb_rpc("twitter_server", "getF", $msg2, $link); $rs2 = peb_decode($result2); $msg3 = call_user_func_array('array_merge', $rs2); print_r($msg); echo '<br/>'; if (count($msg3) > 2) { $f3 = $msg3[0] * -1; print_r($f3); echo '<br/>'; $s3 = $msg3[1]; print_r($s3); echo '<br/>'; $th3 = $msg3[2]; print_r($th3); } if (count($msg3) < 2) { // Header("Location: http://site1.local/404.php");
mb_internal_encoding('UTF-8'); ?> <?php $word = $_SESSION['Test']; $link = peb_connect("cat@food", "abc"); if (!$link) { // die('Could not connect: ' . peb_error()); Header("Location: http://site1.local/404.php"); //echo'link error'; } $msg = peb_encode("[~s]", array(array($word))); //print_r($msg); //The sender must include a reply address. use ~p to format a link identifier to a valid Erlang pid. $result = peb_rpc("server", "count_tags", $msg, $link); $rs = peb_decode($result); $msg = call_user_func_array('array_merge', $rs); $arr = $msg; $wo = array(); $indexF = array(); $num = array(); $x = 0; $z = 0; $length = count($arr); for ($i = 0; $i < $length; $i++) { if ($i % 2 == 0) { $wo[$x] = mb_strtolower($arr[$i]); $x++; } if ($i % 2 != 0) { $num[$z] = $arr[$i];
<?php /** NOTE this requires the use of the mypeb PHP extension http://code.google.com/p/mypeb/ **/ echo "\n\nRUNNING MYPEB Erlang Bridge Tests\n\n"; $link = peb_connect('erlnode', 'secret'); echo "The link is: " . $link; if (!$link) { die('Could not connect: ' . peb_error()); } $msg = peb_encode('[~a,~p,~s]', array("echo", array($link, 'getinfo'), "Hello World")); //The sender must include a reply address. use ~p to format a link identifier to a valid Erlang pid. peb_send_byname('erlnode', $msg, $link); $message = peb_receive($link); $rs = peb_decode($message); print_r($rs); $serverpid = $rs[0][0]; peb_close($link);