toxa@vinga:~$ php -r "var_export(explode('|', '1|3|4||||4|||'));"
array (
0 => '1',
1 => '3',
2 => '4',
3 => '',
4 => '',
5 => '',
6 => '4',
7 => '',
8 => '',
9 => '',
)
if (!empty($ip_addr) && filter_var($ip_addr, FILTER_VALIDATE_IP)) {
$pr_ip = explode(".", $ip_addr);
$my_ip = $pr_ip[0].$pr_ip[1].$pr_ip[2];
} else {
$my_ip = '';
}
var data = $(this).serialize();
let btnData = $('#games_sorted').val();
console.log(data + '&games_sorted_name=' + btnData);