my code

Main class loader

Snippet options

Download: Download snippet as wellartphp.php.
Copy snippet: For this you need a free my code account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!


function curPageURL() {
 $pageURL = "";
 if ($_SERVER["SERVER_PORT"] != "80") {
 } else {
 return $pageURL;

class cnx{
	var $cnx;

	function __construct(){
		$this->cnx = new mysqli(DB_HOST,DB_USER,DB_PASS,DB_NAME);
		return $this->cnx;
    //funcion para escapar los campos antes de incluírlos en consultas sql
	function escapar($str){
		$str = filter_var($str,FILTER_SANITIZE_FULL_SPECIAL_CHARS);
		return $this->cnx->real_escape_string($str);

	//regresa false en caso de no ser un string o tener longitud igual a cero.
	//regresa el numero espacios en blanco en caso de contener.
	function blankSpaces($str){
			if(strlen($str) > 0){
				$count = substr_count($str," ");
				return $count;
		return false;
    //regresa true si un string tiene valor o false si está vacío.
	function hasVal($str){
		if(strlen($str) === 0){ return false; }
		if(!isset($str)){ return false;}
		return true;

//aquí se van a ir incluyendo las demás clases

Create a free my code account now.

my code is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.