Skip to content

PHP Unicode to character conversion

I receive country names like from a library: “u00c3u0096sterreich”. How do I convert this to Österreich? Using PHP 7.3 Answer This one is a lot trickier than it seem, but the below code appears to work. First we pipe it through the standard regex for Unicode escape sequences, then pack that as a b…

Get closest city from array

I would like to create a function that returns the closest city (and the remaining distance to the city) from an array. The numbers in the array represent the distance from the Starting point. $…

Eloquent Count nested relationships

| Data | DataChildren | Category ———————————- | id | id | id | name | data_id | name | | category_id | | | name |…

RUN API inside SQL database upload

I have an API to do an action for a site. The API works and does what it needs to be done. The API information is populated from a form I have. the form also needs to upload information to MYSQL database using SQL I have the following SQL The above works as the header runs the API, but once

Array to string conversion when calling array

i want to send data array using curl. $email = $_SESSION[‘useremail’]; $exam_code = $this->input->post(‘exam_code’); $bank_question = [‘3343’, ‘3345’, ‘3333’]; $…