Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Html parser error even if the url is correct #16

Open
adydevil opened this issue Nov 20, 2017 · 0 comments
Open

Html parser error even if the url is correct #16

adydevil opened this issue Nov 20, 2017 · 0 comments

Comments

@adydevil
Copy link

Hello,

I have used link preview to fetch data as it was working well as i have some logical changes in my code due to requirement..previously i was checking through regular expression as if the so called text has link then with the help of preg_match i will retrieve it and it will parse to your function to get all info and after the logical changes in my code for the scenario if user will enter two urls if there text contains normal url and youtube url..

$fn_url="https://www.example.com";

if($fn_url != "")
{
$previewClient = new Client($fn_url);
$preview = $previewClient->getPreview('general');
$preview = $preview->toArray();

}

if i pass variable in new Client it throwing me error all the time and if i passed the same value as static string then it is giving output with so called info in array.previously it was working well
as the code was like..and it was working well..

if(preg_match(($reg_exUrl,$text,$match))
{
$previewClient = new Client($match[0]);

            $preview = $previewClient->getPreview('general');
            $preview = $preview->toArray();

}

so please guide me if i am making any mistake..
if it can be implemented in laravel 5.4 can i get example for it..

Thanks in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant