Embeddings with php or curl

Hi, I’ll say straight away that I recently approached AI.
I have already used the openai API to use chat completions with excellent results.
I wanted to move on to the next step: creating a chatbot that responds based on a context. I know I have to use embeddings but everything I’ve found uses python, which isn’t my language.
I use php and in particular an old version (in fact I don’t use curl). Can anyone help me understand how I can use curl for embedding?
I saw this piece of code from the documentation:

curl https://api.openai.com/v1/embeddings \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "The food was delicious and the waiter...",
    "model": "text-embedding-ada-002",
    "encoding_format": "float"
  }'

but I don’t understand how to use it in the chatbot and how to do embedding starting from data contained in a website or in a document.

Not a PHP expert myself, we have a few on the forum though. However, ChatGPT is pretty good at translating python code into PHP, so you could show ChatGPT the python code and ask it to translate it, that would get you started.

https://github.com/openai-php/client#embeddings-resource this at least minics that curl example