twittoris Posted September 6, 2010 Share Posted September 6, 2010 I am trying to insert a variable into this post string: curl_setopt ($ch, CURLOPT_POSTFIELDS, 'p_entity_name=The+Company+Name+LLC&p_name_type=A&p_search_type=BEGINS'); I want to replace company name with $name like: curl_setopt ($ch, CURLOPT_POSTFIELDS, 'p_entity_name='+ $name + 'p_name_type=A&p_search_type=BEGINS'); Link to comment https://forums.phpfreaks.com/topic/212699-formatting-variable-in-a-string/ Share on other sites More sharing options...
mraza Posted September 6, 2010 Share Posted September 6, 2010 ($ch, CURLOPT_POSTFIELDS, 'p_entity_name='. $name .'&p_name_type=A&p_search_type=BEGINS'); u need to use concatenation operator Link to comment https://forums.phpfreaks.com/topic/212699-formatting-variable-in-a-string/#findComment-1107957 Share on other sites More sharing options...
twittoris Posted September 6, 2010 Author Share Posted September 6, 2010 Thanks I actually just tried that. Now I need to format the string to convert special characters like S&H Equities LLC what command do i use for that? Link to comment https://forums.phpfreaks.com/topic/212699-formatting-variable-in-a-string/#findComment-1107962 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.