What do you want to save?
Add Code snippet
New code examples
-
TypeScript 2022-03-03 08:25:04
remove products in checkout page woocommerce
/** * Allows to remove products in checkout page. * * @param string $product_name * @param array $cart_item * @param string $cart_item_key * @return string */ function lionplugins_woocommerce_checkout_remove_item( $product_name, $cart_item, $ca... Add solution -
PHP 2022-03-01 03:25:12
recuperer des informations d'une table parent en sql
If you want to handle sessions with a class, I wrote this little class: <?php /* Use the static method getInstance to get the object. */ class Session { const SESSION_STARTED = TRUE; const SESSION_NOT_START... Add solution -
PHP 2022-02-24 15:40:03
php function to convert string to camelcase
public static function camelCase($str, array $noStrip = []) { // non-alpha and non-numeric characters become spaces $str = preg_replace('/[^a-z0-9' . implode("", $noStrip) . ']+/i', ' ', $str); $str = trim($str); ... Add solution -
PHP 2022-02-03 09:40:30
php array_walk_recursive
Flatten multidimensional associative array to array function flatten(array $array, $prefix="") { $result = Array(); array_walk($array, function ($value, $key) use ($array, $prefix, &$result) { $path = $prefix ? "$prefix... Add solution -
Other 2022-02-01 13:45:13
array_walk_recursive get return value
Flatten multidimensional associative array to array function flatten(array $array, $prefix="") { $result = Array(); array_walk($array, function ($value, $key) use ($array, $prefix, &$result) { $path = $prefix ? "$prefix... Add solution -
PHP 2022-01-23 07:21:03
laravel Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException The GET method is not supported for this route. Supported methods: HEAD.
*/ protected function methodNotAllowed(array $others, $method) { throw new MethodNotAllowedHttpException( $others, sprintf( 'The %s method is not supported for this route. Supported methods: %s.... Add solution -
Other 2021-11-21 07:54:14
creating your own symfony choice type
// src/Form/Type/OrderType.php namespace App\Form\Type; use App\Form\Type\ShippingType; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; class OrderType extends AbstractType { public function buildForm(FormBu... Add solution