You have two issues with your code:
1) as you navigate a site with a real browser cookies are stored/updated when pages are get and sent back to the server on every subsequent request. You're not storing cookies nor sending them.
2) the token
you're passing varies upon each request. It's a kind a "secret code" to validate the request.
To solve this, first you have setup curl options to manage cookies. Cookies will be stored in a small text file of your choice.
Then you have to split the task in two steps:
first step: load the page and parse the token
second step: send the post request passing the parsed token
This is some modification of your original code. You can run it from the command line too.
The only non-trivial part is extracting the token but, actually, it's just string manipulation.
<?php
// Load the page
$curl=curl_init();
curl_setopt($curl, CURLOPT_URL, "https://www.turkiye.gov.tr/btk-numara-tasima");
// curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER["HTTP_USER_AGENT"]);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_VERBOSE, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($curl, CURLOPT_COOKIEFILE, 'cookies.txt' ); // <-- read/write cookies into a text file
curl_setopt($curl, CURLOPT_COOKIEJAR, 'cookies.txt' ); // <-- read/write cookies into a text file
$content = curl_exec($curl);
curl_close( $curl );
// Parse output to extract token
$content = substr( $content, strpos( $content, '<input type="hidden" name="token" value="' ) + strlen( '<input type="hidden" name="token" value="' ) );
$token = substr( $content, 0, strpos( $content, '"' ) );
$token = urlencode( $token );
// This is the number to query
$number = '5441234567';
// Put together token and number
$data = 'txtMsisdn=' . $number . '&token=' . $token;
// Perform post request
$curl=curl_init();
curl_setopt($curl, CURLOPT_URL, "https://www.turkiye.gov.tr/btk-numara-tasima?submit");
//curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER["HTTP_USER_AGENT"]);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
curl_setopt($curl, CURLOPT_VERBOSE, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($curl, CURLOPT_COOKIEFILE, 'cookies.txt' ); // <-- read/write cookies into a text file
curl_setopt($curl, CURLOPT_COOKIEJAR, 'cookies.txt' ); // <-- read/write cookies into a text file
$content = curl_exec($curl);
curl_close( $curl );
// Parse output
$content = substr( $content, strpos( $content, '<div class="reminderContainer">' ) + strlen( '<div class="reminderContainer">' ) );
$result = substr( $content, 0, strpos( $content, '</div>' ) );
echo $result . "
";