0

I'm working on a project and hope someone can help me.

I build a tool in Laravel which generates sales invoices and I would like to pass the link to the related document in the invoice. The thing is, that I don't have an access to the invoice layout, It's an existing program, I use API to pass the data. I can pass the link sort of "https://mySite/myFiles/667777.pdf" and it's clickable. But it doesn't look pretty in the document. I would like the customer do not see all the path, but have only smthg like 'click me'. My question is, how to send

 <a href='https://mySite/myFiles/667777.pdf'>click me</a> 

via API to receive clickable 'click me'?

I tried html_entity_decode, but it doesn't work. Will appreciate any suggestions

    $orig = "<a href='/'> click here </a>";
    $conv = html_entity_decode($orig);

    dd($conv); returns "<a href='/'> click here </a>"
Natalia
  • 55
  • 8
  • What entities are you trying to decode, in a text string that contained _none whatsoever_ in the first place? – CBroe Jan 12 '22 at 09:52
  • _"My question is, how to send [...] via API to receive clickable 'click me'?"_ - how could we possible answer that, we have absolutely no information about how this API works so far. – CBroe Jan 12 '22 at 09:53
  • I'm not that proficient in php. I see that decode doesn't work, but I don't know what works and if it's even possible somehow to pass html link and receive only clickable text in between tags, how would I get if I would write html page myself – Natalia Jan 12 '22 at 09:56
  • I am guessing the API expects text data, not HTML - so the entity encoding of the characters with "HTML meaning" probably happens on their end. If that is the case, then there is nothing you can do about that. But you should really go and read the API documentation to verify this, instead of having us guess. – CBroe Jan 12 '22 at 09:58
  • Didn't find anything related to this topic, but ok, will keep searching. As I said I'm not yet experienced, so I don't know all the functionality what's possible. Hoped there is some simple analog to html_decode I don't know about. Thank you for a feedback. – Natalia Jan 12 '22 at 10:06
  • 1
    If this API does not _want_ you to be able to insert HTML, then there is nothing you can do about that - they will be doing the entity encoding on their end then. – CBroe Jan 12 '22 at 10:09

0 Answers0