Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass data containing special characters through curl

Tags:

php

curl

I cannot able to post data its contain the special characters through curl ,Any solution ?

first code is my curl function ,second code is my data need to pass

$communication_data_string = 'token='.json_encode(array(
    "activityTypeId"=>12,
    "activityId"=>5,
    "userID"=> 10,
    "partyID"=>20,
    "message_area_name"=>("this is my test data with special cheractors&&!@##$%$%%*)++")
    )
); 

echo(datPostingCURL($url, $communication_data_string));

?>

this seems to not returning anything if the messageData contains the special character's

like image 813
Darsana.K Avatar asked Nov 24 '25 13:11

Darsana.K


1 Answers

Try urlencode

or

How about using the entity codes...

@ = %40

& = %26
like image 108
vijaykumar Avatar answered Nov 26 '25 03:11

vijaykumar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!