Created
May 26, 2016 16:08
-
-
Save ederrafo/b9c7efcd95caa1c37521777200f10fcd to your computer and use it in GitHub Desktop.
php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$data = "This is somsde /<b>bold</b> text."; | |
$data = trim($data); | |
// $data = stripslashes($data); | |
$data = htmlspecialchars($data); | |
echo $data; | |
/*Formatear cadena de caracteres. reemplazar caracteres en un string*/ | |
/*strings*/ | |
$string = "Hello my name is %s %s"; | |
$firstName = "Eder"; | |
$lastName = "Pariona Espinhal"; | |
$txt = sprintf($string, $firstName, $lastName); | |
echo $txt; | |
/* numbers and strings */ | |
$number = 9; | |
$str = "Beijing"; | |
$txt = sprintf("There are %u million bicycles in %s.",$number,$str); | |
echo $txt; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment