Ver Mensaje Individual
  #3 (permalink)  
Antiguo 15/07/2016, 09:28
alternativedani
 
Fecha de Ingreso: mayo-2016
Mensajes: 8
Antigüedad: 8 años
Puntos: 0
Respuesta: Concatenar en PHP

Cita:
Iniciado por MaNuX0218 Ver Mensaje
Si la lo tienes definido solo tendrias que añadirlo.

Código PHP:
Ver original
  1. $user['uniqueid'] = $respuesta['pvatributo1Out'];
  2. $user['name'] = $respuesta['pvatributo3Out'];
  3. $user['email'] = $respuesta['pvatributo6Out'];
  4.  
  5. echo 'Mi '.$user['name'].' '.$user['email'];

Creo que lo que pretendes es eso.

Saludos.
Bueno, extiendo un poco la sintaxis de mi código, este es mi código completo:

Código:
<?php
require('functions.jsconnect.php');
require_once("lib/nusoap.php");

// 1. Get your client ID and secret here. These must match those in your jsConnect settings.
$clientID = "xxx";
$secret = "xxx";

// 2. Grab the current user from your session management system or database here.
$signedIn = true; // this is just a placeholder

// YOUR CODE HERE.

// 3. Fill in the user information in a way that Vanilla can understand.
$user = array();

if ($signedIn) {
   // CHANGE THESE FOUR LINES.
$cliente = new nusoap_client("https://www.mipagina.com/webservice?wsdl");

$usuario = "aquí hay un usuario";
$cveapp = "aquí hay valor de app";

$parametros = array ('pVusuarioenc'=>$usuario,'cveapp'=>$cveapp);
$respuesta = $cliente->call("validausuario",$parametros);

   
   $user['uniqueid'] = $respuesta['pvatributo1Out'];
   $user['name'] = $respuesta['pvatributo3Out'];
   $user['email'] = $respuesta['pvatributo6Out'];
}

// 4. Generate the jsConnect string.

// This should be true unless you are testing. 
// You can also use a hash name like md5, sha1 etc which must be the name as the connection settings in Vanilla.
$secure = 'sha1'; 
WriteJsConnect($user, $_GET, $clientID, $secret, $secure);
JsSSOString($user, $clientID, $secret);
Dentro del IF de $signedIn se consume un servicio que hace que inicies sesión dentro de una página web sin tener que registrarte (Single Sign On) y al final del IF antes dicho hace una especie de echo --> $user['name'] = $respuesta['pvatributo3Out'] , lo que imprime pvatributo3Out es mi nombre, pero lo que yo quiero es que en esta misma línea imprima también pvatributo4Out que es mi apellido... me explico?

¿Cómo puedo concatenar ['pvatributo3Out'] y ['pvatributo4Out'] dentro de $user['name'] = $respuesta['¿¿¿???'];