PHP code example of prajwal89 / share-to

1. Go to this page and download the library: Download prajwal89/share-to library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

prajwal89 / share-to example snippets


composer 



use Prajwal89\ShareTo;

$share = new ShareTo('McqMate - MCQ Portal for Students', 'https://mcqmate.com/');
echo $share->all()->getButtons();

echo $share->all()->getButtons();

echo $share->whatsapp()->getButtons();

echo $share->whatsapp()->twitter()->getButtons();
//or
echo $share->only(['whatsapp','twitter'])->getButtons();


$share->all()->getRawLinks();

 $options = [
  //options for container
  'buttonGap' => 10, //in px
  'alignment' => 'center', // accepts (start|center|end) alignment of of buttons in container
 
  //options for button
  'borderWidth' => 2, 
  'radius' => 4,
  'paddingX' => 4,
  'paddingY' => 8,
 ];
 
$share = new ShareTo('McqMate - MCQ Portal for Students', 'https://mcqmate.com/',$options);
echo $share->all()->getButtons();