Skip to content

Instantly share code, notes, and snippets.

@didagu
Last active March 17, 2020 07:12
Show Gist options
  • Save didagu/4add27f052e1a1ca84847515976b2221 to your computer and use it in GitHub Desktop.
Save didagu/4add27f052e1a1ca84847515976b2221 to your computer and use it in GitHub Desktop.
function that returns the string representation of the sum of those integers
<?php
function sumStrings($string1,$string2) {
$result = (int) $string1 + (int) $string2;
return (string) $result;
}
/*
* input: $string1 = "1", $string2 = "2"
*/
/*
* output: "3"
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment