search key & value in multidimensional array in PHP

function searcharr($array, $key, $value)
{
$results = array();

if (is_array($array)) {
if (isset($arrayvariation[$key]) && $array[$key] == $value) {
$results[] = $arrayvariation;
}

foreach ($array as $subarray) {
$results = array_merge($results, $this->searcharr($subarray, $key, $value));
}
}

return $results;
}

Advertisements

configure XAMPP to send mail from localhost

in the file

C:\xampp\php\php.ini

uncomment this by removing the semicolon ;

extension=php_openssl.dll

and comment this
sendmail_path=”C:\xampp\mailtodisk\mailtodisk.exe”

 

, file find [mail function] and change

SMTP=smtp.gmail.com
smtp_port=587
sendmail_from = my-gmail-id@gmail.com
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

Then  Open C:\xampp\sendmail\sendmail.ini. Replace all the existing code in sendmail.ini with following code

[sendmail]

smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=my-gmail-id@gmail.com
auth_password=my-gmail-password
force_sender=my-gmail-id@gmail.com



Cakephp Polls Plugin

Cakephp Polls Plugin

on github

https://github.com/amdmaher/Cakephp-Polls-Plugin

Cakephp Polls Plugin , Multi Poll

Activation instructions

just add the plugin folder to app/plugin

and load the plugin in app/Config/bootstrap.php

CakePlugin::load(‘Polls’);

create the schema

$ Console/cake schema create

from the plugin schema file

you can add polls and polls options throught the admin link

yourapp/admin/polls

now You can use multi Poll plugin

by calling the poll element anywhere

<?php echo $this->element(‘Polls.vote’,array(‘model’ => ‘how2’)); ?>

where the model is the name of poll