Inserting avatar via URL image

  • Thread starter Thread starter RisteD
  • Start date Start date

RisteD

Guest
Member
My repository:
PHP:

Code:

Code:
<?php
namespace XF\Repository;
use \XF\Mvc\Entity\Repository;
use XF\PrintableException;

class UserNFT extends Repository
{
    protected $finder,$entity;

    public function getImageData(string $imageUrl)
    {
        $ch = curl_init();
        curl_setopt($ch,CURLOPT_URL,$imageUrl);
        curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
        $data = curl_exec($ch);
        curl_close($ch);
        $response = json_decode($data,true);
        return $response...

Read more

Continue reading...
 
Top