Are the contents of $_SERVER[‘HTTP_USER_AGENT’] always English characters

I have looked for a list of all $_SERVER[‘HTTP_USER_AGENT’] but could not find one that was robust. I want to know if the contents of the $_SERVER[‘HTTP_USER_AGENT’] are always unicode English characters, so that I can strip high AND low level bytes from the string before I evaluate it.

such as:


Do any foreign browsers use local language characters?

Part of an array is no accessed trough foreach

I am creating a bot for telegram using Botman and I have an issue when trying to get a value from an API response.

This is my class that proccesses the response and returns the message to the user, you can see the API adress.

class TaxiService {

protected $client;
const TAXI_ENDPOINT = '';

 * DogService constructor
 * @return void
public function __construct(){
    $this->client = new Client();

public function hireTaxi(){
    try {
        $endpoint = sprintf(self::TAXI_ENDPOINT, 'Madrid');

        $response = json_decode(

        foreach($response as $key => $value){
            foreach($value as $key2 => $value2){
                    foreach($value2 as $key3 => $value3){
                        $lon = $value3;

        return $lon;
    } catch (Exception $e) {
        // If anything goes wrong, we will be sending the user this error message.
        return 'An unexpected error occurred. Please try again later.';


This is the response I get when calling the API.


When I iterate trough the Array given by ´json_decode´ the ´$long´ variable returns ´Hello´, it doesn’t set any value when looping trough the array.

What I want to get is one of the values in the location position of the JSON.

I have tested my function with this site: and it gives me a value belonging to the JSON which is what I want but it seems the function is not working in my application.

Yii Framework and Create profile

I have a little problem with and yiiframework
I need to create a customer account in system with data from my webiste with api.
I’m using this extension , but without success.
Share with you what I’m trying to do
ajax return is with code 500
The variable error should return error or success, but actually return nothing
thanks in advance

            $userInfo = [
                'type' => 'Payment',    //Payment OR Withdraw
                'user_id' => 12314,
                'profile_id' => 1231231,
                'email' => $this->data['email_address'],
            echo Yii::app()->authorizenetCIM->authNetCreateProfile($userInfo);
            // $result = Yii::app()->authorizenetCIM->authNetCreateProfile($userInfo);
            if ($result != "error") {
                $this->msg = t("success");
                return ;
            } else {
                return ;

    public function authNetCreateProfile($data) //$type = Payment OR Withdraw
    //build xml to post
    $content =
        "<?xml version=\"1.0\" encoding=\"utf-8\"?>" .
        "<createCustomerProfileRequest xmlns=\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\">" .
        "<merchantCustomerId>" . CHtml::encode(strip_tags($data['type']))."-".CHtml::encode(strip_tags($data['user_id']))."-".CHtml::encode(strip_tags($data['profile_id']))  ."</merchantCustomerId>". // Your own identifier for the customer.
        "<email>" . CHtml::encode(strip_tags($data['email'])) . "</email>".

    $response = $this->sendXMLRequest($content);    
    $parsedresponse = $this->parseAPIResponse($response);   

    if ("Ok" == $parsedresponse->messages->resultCode) {
        return htmlspecialchars($parsedresponse->customerProfileId);

    return "error";

[unixODBC][Driver Manager]Can’t open lib ‘/opt/vertica/lib64/’ : file not found

Right now I am trying to connect with vertica using PHP on Ubuntu. And I am getting this error

PHP 7.2.7
Ubuntu 18.04

[unixODBC][Driver Manager]Can't open lib '/opt/vertica/lib64/' : file not found

I already have that file in that route with all permissions.

This is my /etc/odbcinst.ini

Description = Vertica driver
Driver   = /opt/vertica/lib64/
Driver64 = /opt/vertica/lib64/

This is my /etc/vertica.ini

ODBCInstLib = /usr/lib/x86_64-linux-gnu/

I got the file from vertica-client-fips-9.1.0-0.x86_64.rpm

I hope someone can help me

Edit search target of a post grid plugin on wordpress

i have a website called “”.
i installed a plugin called “Post grid” which displays the posts on my website in a grid format based on pre specified categories and custom taxanomies.
Now when i use the native search option of my wordpress theme it does not display the result in the format as the post grid so i am forced to use the search option provided inside the post grid plugin.
The only problem with the search option in the post grid plugin is that i can enable or disable the search option for a specific post grid and that the search of that specific post grid will only look for posts that belong in that specific grid.
taking an example: if i make a grid based on the category “comedy” that grid will only display posts that fall into the category “comedy” and when i search from the search bar of that post it will only search for posts that belong to the category “comedy” and not for all the posts.
so basically i made a grid and selected all the categories in it, so now the search for grid can search posts of all categories. What i want is for the search from all my various grids to use the search i made for a the grid with all the categories.
i would also like to change the functionality of the search, the current way of its functioning is “type to search”, “press enter to reset” and i would like to change it to “press enter once to search”, “press enter twice to reset”.

Inspect element of the search of the grid which includes all categories (i want all other searches from other grids to search from this grid/search)

screenshot of another grid with a search option, i want to edit the search option of this grid and i want it to use the search from the previous grid as shown in the screenshot

Screenshot of the post grid plugin

Receiving HTTP ERROR 500 when attempting to write code to SQL server in PHP [duplicate]

This question already has an answer here:

I’m trying to create a login for my website but I keep receiving HTTP ERROR 500. I’ve read that this error is a server error and could be caused by using an outdated version of MySQL. I am using Godaddy Cpannel hosting so I don’t have the option to update it. Could there be anything fundamentally wrong with my code that is causing this error instead?


$con = mysqli_connect('localhost','simpleusereitan','12345','nuthead_database');

   echo "Failed to connect:" . mysqli_connect_error();
   echo "Connection ok";
   echo "Error: " . mysqli_error($con);
//consistently returns connection ok

if isset($_POST['submit'])) {

    $uid = mysqli_real_escape_string($con, $_POST['uid']);
    $pwd = mysqli_real_escape_string($con, $_POST['uid']);

    //Error handlers
    //Check if inputs are empty
    if (empty($uid) || empty($pwd)) {
        header("Location: ../index.html?login=empty")
    } else {
        $sql = "SELECT * FROM users WHERE user_uid='$uid'";
        $result = mysqli_query($con, $sql);
        $resultCheck = mysqli_num_rows($result);
        if ($resultCheck < 1) {
            header("Location: ../index.html?login=error")
        } else {
            if ($row = mysqli_fetch_assoc($result)) {
                //De-hasing the password
                $hashedPwdCheck = password_verify($pwd, $row['user_pwd']);

                if ($hashedPwdCheck == false) {
                    header("Location: ../index.html?login=error")
                } elseif ($hashedPwdCheck == true){
                    //log in user here
                    $_SESSION['u_id'] = $row['user_id'];
                    $_SESSION['u_first'] = $row['user_first'];
                    $_SESSION['u_last'] = $row['user_last'];
                    $_SESSION['u_email'] = $row['user_email'];
                    $_SESSION['u_uid'] = $row['user_uid'];
                    header("Location: ../index.html?login=success")

}   else {
    header("Location: ../index.html?login=error")