Questions tagged as 'php'

2
answers

How to create array dynamically?

I would like to dynamically create a array , I tried this way: $zt = array(); $zt = ($p_p[0] => $_p_p[1]); print_r($zt); $p_p is an array , where index 0 is the name, and index 1 is the value, 2 name, 3 value .. $p...
asked by 16.03.2015 / 17:57
2
answers

How to make a form with date field? (DD / MM / YYYY)

I am a beginner in Kohana and need to make a form with a date field. My form is this: <?=form::open('controllerInscricao/index')?> <?php echo form::select('TURMA_codturma', $TURMA_codturma); ?> <br><br> <div>Matr...
asked by 01.02.2015 / 23:37
3
answers

Insert data from a combobox into a SELECT

Good afternoon! I have the following problem, I have to withdraw reports from a certain database where I should select specific employees, the same should be selected from a combobox: <select name="usuario" id="usuario"> &l...
asked by 30.04.2015 / 19:02
2
answers

Problem with Regex in PHP

I have the following function that is used to take special characters from a string: function removeSpecialChars($string){ //List (Array) of special chars $pattern = array("/(á|à|ã|â|ä)/","/(Á|À|Ã|Â|Ä)/","/(é|è|ê|ë)/","/(É|È|Ê|Ë)/","/(í|ì|...
asked by 11.12.2018 / 14:10
3
answers

Difference between create and fill - laravel method

I was developing a web service with laravel, and I realized that I can save the data in my bank in two ways: Product::create($request->all()); or else: $product = new Product(); $product->fill($request->all()); $product->save(...
asked by 23.04.2018 / 14:08
3
answers

Problem in the order of select

I fed this chart ButIhaveaprobleminselectingit<?php$sql_2_vis=mysqli_query($config,"SELECT data, uniques, pageviews FROM tb_visitas ORDER BY id DESC LIMIT 7") or die(mysqli_error($config)); if(@mysqli_num_rows($sql_2_vis) <= '0'){...
asked by 11.05.2018 / 14:02
2
answers

Generate a string that only contains the numbers of another string in php

I made the following function in php that receives a string, and returns a new string containing only the numbers of the received string. I just can not concatenate each number to this new string. I've tried the following: function extraiSo...
asked by 03.06.2018 / 19:41
3
answers

Generate Unique Checking Serials

Someone knows how I can do a single serial system in a way that never repeats the same serial, I heard that with rand and md5 to do but I'm not sure that one hour it will not happen again.     
asked by 05.11.2015 / 17:29
3
answers

How to relate category instance to a product instance in PHP

I have 2 classes in PHP, Product and Category. Following the code for each. Product.php class Produto { public $nome; public $categoria; } Category.php class Categoria { public $nome; } In this case, what I just wa...
asked by 13.11.2015 / 13:11
4
answers

Repeat the alphabet similar to the excel columns

I'm creating a function that returns the alphabet in an array according to the size of passed columns. At first I was only looping using the range ("A", "Z"); but when I had more than 26 columns I did not answer any more, what I found was a...
asked by 30.10.2015 / 19:22