Search Unity

Unity string[] split to PHP email send.

Discussion in 'Scripting' started by Slyrfecso1, Nov 26, 2015.

  1. Slyrfecso1

    Slyrfecso1

    Joined:
    Jul 16, 2012
    Posts:
    100
    Hi,

    I'd like to split strings and attaching them to e-mail.

    1. private string nevek;

    2. Form2.AddField ("nevekE", nevek); //I have sent them with Enumerator to php

    3. $nevekE= $_REQUEST["nevekE"]; //This is receiving strings from unity

    4. $piecesN = explode(" ", $nevekE); //After words are one space

    5. $piecesN[0]<br/>
    At this point the string isn't exploded. If I add strings manually to php, then working,
    but when I importing from Unity isn't exploding.


    Any idea will be helpful!
     
  2. apsdsm

    apsdsm

    Joined:
    Sep 26, 2013
    Posts:
    56
    There's no way we can't help unless you show us the code you already have.
     
  3. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,436
    maybe space character gets encoded to something else ?
     
  4. Slyrfecso1

    Slyrfecso1

    Joined:
    Jul 16, 2012
    Posts:
    100
    I think the codes are enough, the problem is the split/explod in php.
    I have a lot of names between commas, this is $nevekE.

    $try1 = "A B C D" // Explode working well
    $try2 = coming from Unity, the result is a row without line break.

    Screenshot from Mail.


    Response from PHP :
    echo $piecesN[0];

     
    Last edited: Nov 26, 2015
  5. Slyrfecso1

    Slyrfecso1

    Joined:
    Jul 16, 2012
    Posts:
    100
    You have right mgear!!!!!!
    Thank you so much!!!!!!!!!!!
    :)

    I have used "\n", not space.
    nevek +=database.items.itemName + "\n";

    And when I tried to explode then I used space but this wasn't good.