A
A
Alino4ka2016-02-17 17:30:27
Steam
Alino4ka, 2016-02-17 17:30:27

How to send a search request to the steam market?

Good afternoon, there is a problem with sending a correct request (?query =)
When $name contains Russian characters, it returns in response: There were no items matching your search. Try again with different keywords.
When I send the same request with a butterfly in English, everything is fine.
What is the correct way to handle $name before sending?

<?php
$name='бабочка';
$url='https://steamcommunity.com/market/search/render/?query='.$name.'&start=0&count=100&search_descriptions=0&sort_column=popular&sort_dir=desc&appid=730';
echo file_get_contents($url);
?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xdef, 2016-02-17
@Alino4ka

php.net/manual/en/function.http-build-query.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question