0

I have a string containing $test = "Hello 'World' ""Hello you!""";

So I need a PHP string which has "a substring in a substring". Are there other delimiters to do so?

Felix S.
  • 13
  • 5
  • More context. What is this needed for? What does this have to do with SQL? – mario Dec 25 '20 at 19:24
  • Normally to get a double quote inside a double quoted string you would escape it with a backslash, like this: `"Hello \"Hello\" Hello"`. – KIKO Software Dec 25 '20 at 19:29
  • I need to put create this in PHP but then insert it into sql – Felix S. Dec 25 '20 at 19:36
  • @FelixS. You don't need "a substring in a substring" when using "sql". If you gave some more context, meaning the actualy code you use, we could probably help you avoid this altogether. – KIKO Software Dec 25 '20 at 19:39
  • Original (german): `["IM SUPPORT MELDEN

    Du wurdest von Felix in den Support gerufen. Bitte finde dich innerhalb der nächsten 5 Minuten auf unserem TeamSpeak (-) im Channel Wurde in Support gerufen ein um die Situation zu klären.

    Solltest du jetzt den Server verlassen oder diese Nachricht ignorieren musst du mit einer Strafe rechnen!

    (Nachricht vom 21.12 - 15:00)",true,false,"slow",true,[1,0,0,1]]` - thats what I need in my database
    – Felix S. Dec 25 '20 at 19:43
  • but i need my php pdo insert request arround it – Felix S. Dec 25 '20 at 19:43
  • That looks more like an array than a string. You want to turn an array into a string first? It's also better to put your code in your question, which you can still edit, instead of in a comment. Most people read your question first, and the comments only when they are interested in your question. Try to make your question as complete as you can. Include the PDO insert code. It is also probably MySQL, not just SQL. – KIKO Software Dec 25 '20 at 19:47

0 Answers0