Adding quotes in string
How do I add quotes into my formatted string ?
my output should be like: sample "quoted text". actually this will go to server console to execute a server cmd. Below code is not working PHP Code:
or client_cmd(id, "echo ^"%s^"", Str2); --shows sample_cmd <value>"" |
Re: Adding quotes in string
You have done it correctly, ^" everywhere you want a quote. Just print it somewhere to test it.
|
Re: Adding quotes in string
Yes, that what should be but I found it not working.
Output is PHP Code:
|
Re: Adding quotes in string
Okay. Something I missed in hurry I guess. Now its working as expected.
THREAD CLOSED! |
Re: Adding quotes in string
It depends on the rest of your command. Echo is a client command and a special command. It will print the next parameter passed into the client's console. When you add quotes, it makes that entire string a single parameter and the quotes are stripped upon printing. As such, echo displaying quotes since it assumes they are the start or end of a parameter, so it is best to use client_print or console_print if you want to print stuff to the client's console.
|
Re: Adding quotes in string
^ Yes correct, I found my it working when I used client_print(print_console, ...) instead echo
|
| All times are GMT -4. The time now is 13:40. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.