Search
 
SCRIPT & CODE EXAMPLE
 

PHP

symfony set content type

use SymfonyComponentHttpFoundationResponse;

$response = new Response();
$response->setContent(json_encode([
    'data' => 123,
]));
$response->headers->set('Content-Type', 'application/json');
Comment

PREVIOUS NEXT
Code Example
Php :: yii2 jquery head 
Php :: laravel: get last id 
Php :: php rotate image 
Php :: phpmyadmin username password check 
Php :: laravel hasMany with join 
Php :: Day of Week Using carbon library 
Php :: how to combine variables and text into a string php 
Php :: what is better, php or javascript 
Php :: image upload in laravel 
Php :: guzzlehttp/guzzle version with laravel-websockek 
Php :: php submit form in new tab 
Php :: php check if a url exists 
Php :: php json decoding as string incorrectly 
Php :: woocommerce get orders by user id 
Php :: laravel route multiple methods 
Php :: laravel array cast 
Php :: laravel seeding with relationships 
Php :: get curret timedate php 
Php :: smarty foreach 
Php :: laravel check environment hlper 
Php :: file upload codeigniter 
Php :: drop column table in migration if exist in laravel 
Php :: laravel relation select fields 
Php :: 301 redirect 
Php :: php get embed code from youtube url 
Php :: laravel restrict route methods 
Php :: Laravel: Set timestamp column to current timestamp 
Php :: how to get data from json array in php 
Php :: laravel mail send to multiple recipients 
Php :: mobile detect in laravel 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =