Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $string = "Hola = 1"
- $valor = 2;
- $string = "Hola = 1";
- $final = $string + $valor;
- echo $final;
- //Salida: Hola = 3
- <html>
- <head>
- <title>Aumentar Valor</title>
- </head>
- <body>
- <form action="./aumentar.php">
- <button type="submit" name="aumentar" value="1">
- <button type="submit" name="aumentar" value="2">
- <button type="submit" name="aumentar" value="3">
- </form>
- </body>
- </html>
- <?php
- include "connect-database.php";
- $valor = mysqli_real_escape_string($conn, $_POST['aumentar']);
- $archivo = fopen("numero.txt", "r");
- $string = fread($archivo);
- fclose($archivo);
- $final = $string + $valor;
- $archivo = fopen("numero.txt", "w");
- $string = fwrite($archivo, $final);
- fclose($archivo);
- echo $final;
- exit();
- $valor = "2";
- $string = "Hola = ";
- $final = $string + $valor;
- echo $final;
- int($valor);
- ToString($valor);
Add Comment
Please, Sign In to add comment