Tag : String



AngularJS - convert comma separated string to array example

When i was working on my Laravel angularjs application, i require to make array from comma separated string, I was not expert in angularjs so i was thingking how is it possible ?, But Finally i was found solution using custom angularjs Filter. So, In this example, I will give you full example of how to convert comma separated string into array and how to print it. We will create array using split() of jquery. But if you know angularjs we can't do it anything directly from layout, So we should create our custom filter, as bellow you can see i created "customSplitString" filter. <strong>Filter:.....

By Hardik Savani | November 24, 2016 | | 21698 Viewer | Category : Bootstrap jQuery AngularJS
READ MORE

How to remove comma from string in jquery with example ?

Sometimes, we require to remove comma, semicolon, colon etc from string in your jquery code At that time you can simply remove comma using js replace(). Jquery replace() through we can replace comma into empty string that way comma will be remove from jquery string. In this example you can see how it works. It small thing but helpful because this you can also delete semicolon ,colon ,dot etc. So, let's try bellow example and see.. <strong>Example:</strong> <pre class="prettyprint lang-html"> <html lang="en"> <head> <title>Jquery remove comma from string</title> &l.....

By Hardik Savani | August 27, 2016 | | 6097 Viewer | Category : Javascript HTML jQuery
READ MORE

How to check if string is URL or not in PHP?

Sometimes, we require to check the given argument or string is URL or not, as specially i did need to check image column is url or not like i give you example how to do this. If you also need to do this then you can use filter_var(). <strong>Example:</strong> <pre class="prettyprint lang-php"> if(filter_var($imagePath, FILTER_VALIDATE_URL) === FALSE){ print_r("Not valide URL"); }else{ print_r("valide URL"); } </pre>

By Hardik Savani | April 18, 2016 | | 1736 Viewer | Category : PHP
READ MORE

AngularJS - How to Limit String Length using Filter?

Some case we have enough space to display content, for example you have articale blog and you want to display saveral articale on homepage with limited content like this way : <pre> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate.... </pre> You can do it easily if you are work on any framework or something, but if you want to do on angular then you need to cr.....

By Hardik Savani | April 14, 2016 | | 6167 Viewer | Category : Javascript jQuery AngularJS
READ MORE

AngularJS - How to Capitalize the first letter of word Using filter?

Sometimes, we want to make Capitalize string in our AngularJS project then we have to create filter because AngularJS not provide any predefined function that can Capitalize word or string. However, you can solve this problem by makeing your own filter that can help you to make Capitalize string or word. so let's see following example and use it. <strong class="example">Create Filter:</strong> <pre class="prettyprint lang-js"> var app = angular.module('myApp', []); app.filter('capitalizeWord', function() { return function(text) { return (!!text) ? text.charAt(0).toUpperCase() + .....

By Hardik Savani | April 13, 2016 | | 12696 Viewer | Category : jQuery AngularJS
READ MORE

AngularJS - how to remove html tags using filter?

Whenever you require to strip HTML tags usign Angular Filter, then this post can help you. If you are working on php then it is very easily use predefine function But in AngularJS you need to make your own filter for remove html tag from string. So, In bellow example you can see how to create and use it. <strong class="example">Create Filter:</strong> <pre class="prettyprint lang-js"> var app = angular.module('myHDApp', []); app.filter('removeHTMLTags', function() { return function(text) { return text ? String(text).replace(/<[^>]+>/gm, '') : ''; }; }); </pre> <strong class="example">U.....

By Hardik Savani | April 12, 2016 | | 24472 Viewer | Category : jQuery AngularJS
READ MORE

How to redirect route with querystring in Laravel 5?

Most of time, we work on back-end and we require to redirect route or url from controller with pass query string parameter. so laravel provide very simple way to pass query string parameter with redirect route. In following example you can see how it is possible. In Bellow example you can see i did added highchart() function for route haddle. in that function i redirect "home" route with 2 parameter as query string like id and itemid, so url will be like this way: <pre>http://test.hd/home?id=2&itemid=3</pre> And controller function will be this way: <strong class="example">Example:</strong> .....

By Hardik Savani | April 8, 2016 | | 13488 Viewer | Category : Laravel
READ MORE

How to generate route with query string parameter in Laravel 5?

Whenever you require to add query string parameter in link url, i mean in route then you generate link with query string parameter using Laravel 5 URL facade. most of new developer doing this way: <pre class="prettyprint lang-html"><a href="{{ URL::route('home') }}.'?id=1&test_id=2'">Test</a></pre> But you should do it that this way, bellow example you can see how it done. <pre class="prettyprint lang-html"><a href="{{ URL::route('home',['id'=>'2','test_id'=>'3']) }}">Test</a></pre>

By Hardik Savani | April 7, 2016 | | 15338 Viewer | Category : Laravel
READ MORE

How to add query string automatically on laravel pagination links ?

For example you are working on items module and you have a index page like listing all items with pagination. also you did give search function on items name. I have a bellow query string when i search something and i want to pass that query string on all pagination link. <strong class="example">Query String URL:</strong> <pre>http://text.hd/admin/products?name=test&page=1</pre> But where is problem. when you search any for example "tes" and get the result but when you click on next page you can't filter on name as you did "tes". so at that time we have to appends that query string on pagina.....

By Hardik Savani | March 30, 2016 | | 7167 Viewer | Category : Laravel
READ MORE

    Laravel 5.3 - image dimension validation rules example

    Laravel 5.3 - image dimension validation rules example

    Open Post

    Laravel 5 - line chart example code using google charts API

    Laravel 5 - line chart example code using google charts API

    Open Post

    Mailgun setup with Laravel 5 example

    Mailgun setup with Laravel 5 example

    Open Post

    How to call AngularJS controller function in Jquery?

    How to call AngularJS controller function in Jquery?

    Open Post

    How to connect mysql database in node js with example?

    How to connect mysql database in node js with example?

    Open Post

    Laravel 5 client side validation using Parsley.js example

    Laravel 5 client side validation using Parsley.js example

    Open Post