<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Php &#8211; MaXEster Technologies  | Technical Blog</title>
	<atom:link href="https://www.maxester.com/blog/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.maxester.com/blog</link>
	<description>Tutorials, Examples and Implementation code for Developers Help</description>
	<lastBuildDate>Mon, 17 Feb 2025 09:17:48 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.22</generator>
	<item>
		<title>PHP Code for Upload File/Image to the server using Volley in Android</title>
		<link>https://www.maxester.com/blog/2020/07/28/php-code-for-upload-image-to-server-using-volley-in-android/</link>
		<comments>https://www.maxester.com/blog/2020/07/28/php-code-for-upload-image-to-server-using-volley-in-android/#respond</comments>
		<pubDate>Tue, 28 Jul 2020 10:07:07 +0000</pubDate>
		<dc:creator><![CDATA[Maxester]]></dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[Core PHP code API for Image Upload]]></category>

		<guid isPermaLink="false">https://www.maxester.com/blog/?p=1018</guid>
		<description><![CDATA[<p>This code will help you upload image to server which I have uploaded on &#8221; “http://seoforworld.com/api/v1/file-upload.php” For using this code create a page with the name file-upload.php.Also, create a directory with name of images Copy this code in file-upload.php Image&#8230;</p>
<p><a href="https://www.maxester.com/blog/2020/07/28/php-code-for-upload-image-to-server-using-volley-in-android/" class="btn-more">Read More<span class="arrow-more">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://www.maxester.com/blog/2020/07/28/php-code-for-upload-image-to-server-using-volley-in-android/">PHP Code for Upload File/Image to the server using Volley in Android</a> appeared first on <a rel="nofollow" href="https://www.maxester.com/blog">MaXEster Technologies  | Technical Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[
<center>
<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Fads -->
<ins class="adsbygoogle fads" style="display:inline-block;" data-ad-client="ca-pub-3804472713147276" data-ad-slot="1267368188"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
</center>



<p>This code will help you upload image to server which I have uploaded on &#8221; <br><strong>“http://seoforworld.com/api/v1/file-upload.php”</strong> <br>For using this code create a page with the name file-upload.php.<br>Also, create a directory with name of images</p>



<p>Copy this code in file-upload.php</p>



<center>
<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Fads -->
<ins class="adsbygoogle fads" style="display:inline-block;" data-ad-client="ca-pub-3804472713147276" data-ad-slot="1267368188"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
</center>



<pre class="wp-block-code"><code>&lt;?php



$api_version = 1.0;

$start = microtime(true);

$dir = $_SERVER['DOCUMENT_ROOT']."/api/v1/images/";



if( isset($_FILES['image']['name']) )

{

    $file_name = time().basename($_FILES['image']['name']);

    

    $extension = strtolower(pathinfo($file_name,PATHINFO_EXTENSION));



        if ($extension == 'png' || $extension == 'jpg' || $extension == 'jpeg') {



            if($_FILES["image"]["size"] &lt; 4000001){

                

                $file = $dir.$file_name;

                

                if( move_uploaded_file($_FILES['image']['tmp_name'], $file) )

                {

                    $arr = array(

                    'status'=>1, 

                    'message'=>"File Uploaded",

                    'file_name'=>$file_name

                    );

                }

                else

                {

                    $arr = array(

                    'status'=>0, 

                    'error'=>"Something Went Wrong Please Retry",

                    'file_name'=>$file_name

                    );

                }

                

            }

            else

            {

                $arr = array(

                'status'=>0,

                'error'=>"File size cant exceed 4 MB"

                );

            }  

        }

        else

        {

            $arr = array(

            'status'=>0,

            'error'=>"Only .png, .jpg and .jpeg format are accepted"

            );

        }

                

}

else{

    $arr = array(

    'status'=>1, 

    'message'=>"Please try Post Method"

    );

}



$arr[ 'api' ] = $api_version;

$arr[ 'time' ] = ( microtime(true) - $start );



print_r( json_encode( $arr ) );



?></code></pre>



<p>Image Folder with this file like</p>



<center>
<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Fads -->
<ins class="adsbygoogle fads" style="display:inline-block;" data-ad-client="ca-pub-3804472713147276" data-ad-slot="1267368188"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
</center>



<figure class="wp-block-image"><img src="https://www.maxester.com/blog/wp-content/uploads/2020/07/php-volly-image1.jpg" alt="" class="wp-image-1019" srcset="https://www.maxester.com/blog/wp-content/uploads/2020/07/php-volly-image1.jpg 542w, https://www.maxester.com/blog/wp-content/uploads/2020/07/php-volly-image1-300x125.jpg 300w" sizes="(max-width: 542px) 100vw, 542px" /></figure>



<figure class="wp-block-image"><img src="https://www.maxester.com/blog/wp-content/uploads/2020/07/php-volly-image2.jpg" alt="" class="wp-image-1020" srcset="https://www.maxester.com/blog/wp-content/uploads/2020/07/php-volly-image2.jpg 561w, https://www.maxester.com/blog/wp-content/uploads/2020/07/php-volly-image2-300x110.jpg 300w" sizes="(max-width: 561px) 100vw, 561px" /></figure>



<center>
<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Fads -->
<ins class="adsbygoogle fads" style="display:inline-block;" data-ad-client="ca-pub-3804472713147276" data-ad-slot="1267368188"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
</center>
<p>The post <a rel="nofollow" href="https://www.maxester.com/blog/2020/07/28/php-code-for-upload-image-to-server-using-volley-in-android/">PHP Code for Upload File/Image to the server using Volley in Android</a> appeared first on <a rel="nofollow" href="https://www.maxester.com/blog">MaXEster Technologies  | Technical Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.maxester.com/blog/2020/07/28/php-code-for-upload-image-to-server-using-volley-in-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What are Laravel View Composer?</title>
		<link>https://www.maxester.com/blog/2019/10/03/what-are-laravel-view-composer/</link>
		<comments>https://www.maxester.com/blog/2019/10/03/what-are-laravel-view-composer/#respond</comments>
		<pubDate>Thu, 03 Oct 2019 04:56:18 +0000</pubDate>
		<dc:creator><![CDATA[Bhaskar Chaudhary]]></dc:creator>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">https://www.maxester.com/blog/?p=680</guid>
		<description><![CDATA[<p>Sometimes we need to pass similar type of data to different view files or partials and later changing them is a pain point as you have to change every single one of them, hence to fix this issue view composers&#8230;</p>
<p><a href="https://www.maxester.com/blog/2019/10/03/what-are-laravel-view-composer/" class="btn-more">Read More<span class="arrow-more">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://www.maxester.com/blog/2019/10/03/what-are-laravel-view-composer/">What are Laravel View Composer?</a> appeared first on <a rel="nofollow" href="https://www.maxester.com/blog">MaXEster Technologies  | Technical Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[
<p>Sometimes we need to pass similar type of data to different view files or partials and later changing them is a pain point as you have to change every single one of them, hence to fix this issue view composers are used.</p>



<p>First we have to open <strong>AppServiceProvider.php</strong> in <strong>app/Providers.</strong></p>



<p>Add View facade to the service provider</p>



<pre class="wp-block-code"><code>use Illuminate\Support\Facades\View;</code></pre>



<p>After adding View Facade add composer code to boot function</p>



<center>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Fads -->
<ins class="adsbygoogle fads"
     style="display:inline-block;"
     data-ad-client="ca-pub-3804472713147276"
     data-ad-slot="1267368188"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
</center>




<pre class="wp-block-code"><code>function boot()
{
       View::composer('page.index', function($view){
            $view->with('data', 'Value This could output of eloquent too')
        });
}</code></pre>



<p><strong>NOTE:</strong> </p>



<center>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Fads -->
<ins class="adsbygoogle fads"
     style="display:inline-block;"
     data-ad-client="ca-pub-3804472713147276"
     data-ad-slot="1267368188"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
</center>




<ul><li><strong>page.index</strong> is the location of targeted blade file in view folder</li><li>You can also use wildcard to target all blade file in a directory (<strong>page.*</strong>)</li><li>To target more than one file you can pass array instead of string. </li></ul>
<p>The post <a rel="nofollow" href="https://www.maxester.com/blog/2019/10/03/what-are-laravel-view-composer/">What are Laravel View Composer?</a> appeared first on <a rel="nofollow" href="https://www.maxester.com/blog">MaXEster Technologies  | Technical Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.maxester.com/blog/2019/10/03/what-are-laravel-view-composer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to get CLI Input in PHP?</title>
		<link>https://www.maxester.com/blog/2019/09/02/how-to-get-cli-input-in-php/</link>
		<comments>https://www.maxester.com/blog/2019/09/02/how-to-get-cli-input-in-php/#respond</comments>
		<pubDate>Mon, 02 Sep 2019 10:52:15 +0000</pubDate>
		<dc:creator><![CDATA[Bhaskar Chaudhary]]></dc:creator>
				<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">https://www.maxester.com/blog/?p=637</guid>
		<description><![CDATA[<p>Php Uses I/O Stream To Get input. So to get a input from user in cli. You can run the php file by opening your CMD in a Windows machine or Terminal in Linux based machine And Getting to the&#8230;</p>
<p><a href="https://www.maxester.com/blog/2019/09/02/how-to-get-cli-input-in-php/" class="btn-more">Read More<span class="arrow-more">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://www.maxester.com/blog/2019/09/02/how-to-get-cli-input-in-php/">How to get CLI Input in PHP?</a> appeared first on <a rel="nofollow" href="https://www.maxester.com/blog">MaXEster Technologies  | Technical Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[
<p>Php Uses I/O Stream To Get input.</p>



<pre class="wp-block-code"><code>fopen ("php://stdin","r") // open a read stream</code></pre>



<p>So to get a input from user in cli.</p>



<pre class="wp-block-code"><code>echo "Type Something: "
$r_stream = fopen ("php://stdin","r");
$input = trim(fgets($r_stream));
echo = "\n";
echo "You Entered ".$input;</code></pre>



<center>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Fads -->
<ins class="adsbygoogle fads"
     style="display:inline-block;"
     data-ad-client="ca-pub-3804472713147276"
     data-ad-slot="1267368188"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
</center>




<p>You can run the php file by opening your <strong>CMD </strong>in a Windows machine or <strong>Terminal </strong>in Linux based machine </p>



<p> And  Getting to the directory in which file is stored and typing the command below.</p>



<pre class="wp-block-code"><code>php file_name.php</code></pre>



<p></p>
<p>The post <a rel="nofollow" href="https://www.maxester.com/blog/2019/09/02/how-to-get-cli-input-in-php/">How to get CLI Input in PHP?</a> appeared first on <a rel="nofollow" href="https://www.maxester.com/blog">MaXEster Technologies  | Technical Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.maxester.com/blog/2019/09/02/how-to-get-cli-input-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to add Helper file in Laravel?</title>
		<link>https://www.maxester.com/blog/2019/08/20/how-to-add-helper-file-in-laravel/</link>
		<comments>https://www.maxester.com/blog/2019/08/20/how-to-add-helper-file-in-laravel/#respond</comments>
		<pubDate>Tue, 20 Aug 2019 12:19:27 +0000</pubDate>
		<dc:creator><![CDATA[Bhaskar Chaudhary]]></dc:creator>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">https://www.maxester.com/blog/?p=621</guid>
		<description><![CDATA[<p>To create custom helpers.php file in laravel we need to edit composer.json file in laravel. In autoload object add the following file array:- After adding this we need to run the following command Make sure composer is installed. This will&#8230;</p>
<p><a href="https://www.maxester.com/blog/2019/08/20/how-to-add-helper-file-in-laravel/" class="btn-more">Read More<span class="arrow-more">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://www.maxester.com/blog/2019/08/20/how-to-add-helper-file-in-laravel/">How to add Helper file in Laravel?</a> appeared first on <a rel="nofollow" href="https://www.maxester.com/blog">MaXEster Technologies  | Technical Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[
<p>To create custom helpers.php file in laravel we need to edit composer.json file in laravel.</p>



<p>In <strong>autoload</strong> object add the following <strong>file </strong>array:-</p>



<pre class="wp-block-code"><code>"autoload": {
    "files": [
        "app/helpers.php"
    ]
},</code></pre>



<p>After adding this we need to run the following command Make sure composer is installed.</p>



<center>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Fads -->
<ins class="adsbygoogle fads"
     style="display:inline-block;"
     data-ad-client="ca-pub-3804472713147276"
     data-ad-slot="1267368188"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
</center>




<pre class="wp-block-code"><code>composer dump-autoload</code></pre>



<p>This will create a <strong>helpers.php</strong> file in your <strong>app </strong>folder. Which will be accessed by all controllers and view files.</p>



<p>Best way to add a function in your Helper file is to check if  it already exist or not</p>



<pre class="wp-block-code"><code>&lt;?php
if (! function_exists('your_custom_helper')) {
function your_custom_helper($string) {
   // your code
}
}</code></pre>



<p></p>
<p>The post <a rel="nofollow" href="https://www.maxester.com/blog/2019/08/20/how-to-add-helper-file-in-laravel/">How to add Helper file in Laravel?</a> appeared first on <a rel="nofollow" href="https://www.maxester.com/blog">MaXEster Technologies  | Technical Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.maxester.com/blog/2019/08/20/how-to-add-helper-file-in-laravel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To pass infinite argument in PHP function?</title>
		<link>https://www.maxester.com/blog/2019/07/18/how-to-pass-infinite-argument-in-php-function/</link>
		<comments>https://www.maxester.com/blog/2019/07/18/how-to-pass-infinite-argument-in-php-function/#respond</comments>
		<pubDate>Thu, 18 Jul 2019 11:36:36 +0000</pubDate>
		<dc:creator><![CDATA[Bhaskar Chaudhary]]></dc:creator>
				<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">https://www.maxester.com/blog/?p=583</guid>
		<description><![CDATA[<p>There are many ways to pass undefined no of arguments in a function. Mostly I use one of these three ways:- Pass all the Argument in the form of an array Use func_get_args () to get all the passed argument&#8230;</p>
<p><a href="https://www.maxester.com/blog/2019/07/18/how-to-pass-infinite-argument-in-php-function/" class="btn-more">Read More<span class="arrow-more">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://www.maxester.com/blog/2019/07/18/how-to-pass-infinite-argument-in-php-function/">How To pass infinite argument in PHP function?</a> appeared first on <a rel="nofollow" href="https://www.maxester.com/blog">MaXEster Technologies  | Technical Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[
<p>There are many ways to pass undefined no of arguments in a function. Mostly I use one of these three ways:-</p>



<ul><li><strong>Pass all the Argument in the form of an array</strong></li></ul>



<pre class="wp-block-code"><code>function sum(array $args){
    $sum = 0;
    
    if( is_numeric( implode("", $args) ) ) 
        {
            foreach($args as $arg){
                $sum += $arg;
                }
            return $sum;
        }
  return "Only array with numeric value accepted";
    
}

// if input is an array with values 1, 2, 3, 5
print_r ( sum([1, 2, 3, 5]) );

//output is 11</code></pre>



<center>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Fads -->
<ins class="adsbygoogle fads"
     style="display:inline-block;"
     data-ad-client="ca-pub-3804472713147276"
     data-ad-slot="1267368188"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
</center>




<ul><li><strong>Use </strong><em>func_get_args ()</em><strong> to get all the passed argument</strong></li></ul>



<pre class="wp-block-code"><code>function makeUrl() {
$args = func_get_args();
  $url = 'https://www.maxester.com/blog/';
  $imp = implode('-', array_filter($args) );
  return $url.lcreplace( $imp ) ;
}

function lcreplace($url) {
return str_replace( "--", "-", preg_replace('/[^A-Za-z0-9-]/', "-", strtolower($url) ) );
}

// input
print_r( makeUrl( "How", "To", "pass", "infinite", "argument", "in", "PHP" ) );
  
//output
https://www.maxester.com/blog/how-to-pass-infinite-argument-in-php</code></pre>



<ul><li><strong>Use PHP Spread Operator(</strong><em> </em>[&#8230;$array]<strong>&nbsp;)</strong></li></ul>



<center>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Fads -->
<ins class="adsbygoogle fads"
     style="display:inline-block;"
     data-ad-client="ca-pub-3804472713147276"
     data-ad-slot="1267368188"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
</center>




<pre class="wp-block-code"><code>function makeUrl(...$args) {

  $url = 'https://www.maxester.com/blog/';
  $imp = implode('-', array_filter($args) );
  return $url.lcreplace( $imp ) ;
}

function lcreplace($url) {
return str_replace( "--", "-", preg_replace('/[^A-Za-z0-9-]/', "-", strtolower($url) ) );
}


// input
print_r( makeUrl( "How", "To", "pass", "infinite", "argument", "in", "PHP" ) );
  
//output
https://www.maxester.com/blog/how-to-pass-infinite-argument-in-php</code></pre>



<p>Each method mentioned above has its own advantages.</p>
<p>The post <a rel="nofollow" href="https://www.maxester.com/blog/2019/07/18/how-to-pass-infinite-argument-in-php-function/">How To pass infinite argument in PHP function?</a> appeared first on <a rel="nofollow" href="https://www.maxester.com/blog">MaXEster Technologies  | Technical Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.maxester.com/blog/2019/07/18/how-to-pass-infinite-argument-in-php-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is Anonymous function or Closure in Php?</title>
		<link>https://www.maxester.com/blog/2019/07/03/what-is-anonymous-function-or-closure-in-php/</link>
		<comments>https://www.maxester.com/blog/2019/07/03/what-is-anonymous-function-or-closure-in-php/#respond</comments>
		<pubDate>Wed, 03 Jul 2019 14:30:02 +0000</pubDate>
		<dc:creator><![CDATA[Bhaskar Chaudhary]]></dc:creator>
				<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">https://www.maxester.com/blog/?p=549</guid>
		<description><![CDATA[<p>These are the function with no defined function. Mostly used for callback. These are accessed by the variables on which they are defined or invoked dynamically.</p>
<p>The post <a rel="nofollow" href="https://www.maxester.com/blog/2019/07/03/what-is-anonymous-function-or-closure-in-php/">What is Anonymous function or Closure in Php?</a> appeared first on <a rel="nofollow" href="https://www.maxester.com/blog">MaXEster Technologies  | Technical Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[
<p>These are the function with no defined function. Mostly used for callback.</p>



<p>These are accessed by the variables  on which they are defined or invoked dynamically.</p>



<center>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Fads -->
<ins class="adsbygoogle fads"
     style="display:inline-block;"
     data-ad-client="ca-pub-3804472713147276"
     data-ad-slot="1267368188"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
</center>




<pre class="wp-block-code"><code>$yourVariable = function(){return 1+1};
//now the variable has 2 as value

$areaOfCircle = function($a){ return 3.14*$a*$a;};
$yourOtherVariable = $areaOfCircle(7);
//now the variable has 153.86 as value </code></pre>
<p>The post <a rel="nofollow" href="https://www.maxester.com/blog/2019/07/03/what-is-anonymous-function-or-closure-in-php/">What is Anonymous function or Closure in Php?</a> appeared first on <a rel="nofollow" href="https://www.maxester.com/blog">MaXEster Technologies  | Technical Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.maxester.com/blog/2019/07/03/what-is-anonymous-function-or-closure-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use multiple where condition in Laravel?</title>
		<link>https://www.maxester.com/blog/2019/07/02/how-to-use-multiple-where-condition-in-laravel/</link>
		<comments>https://www.maxester.com/blog/2019/07/02/how-to-use-multiple-where-condition-in-laravel/#comments</comments>
		<pubDate>Tue, 02 Jul 2019 10:27:00 +0000</pubDate>
		<dc:creator><![CDATA[Bhaskar Chaudhary]]></dc:creator>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">https://www.maxester.com/blog/?p=542</guid>
		<description><![CDATA[<p>You can add where clause to a model like -&#62;where(/*condition*/) Sometimes We need to add orWhere condition to our queries, between two cases. This might interfere with other conditions so we need to pass them in a function. To get&#8230;</p>
<p><a href="https://www.maxester.com/blog/2019/07/02/how-to-use-multiple-where-condition-in-laravel/" class="btn-more">Read More<span class="arrow-more">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://www.maxester.com/blog/2019/07/02/how-to-use-multiple-where-condition-in-laravel/">How to use multiple where condition in Laravel?</a> appeared first on <a rel="nofollow" href="https://www.maxester.com/blog">MaXEster Technologies  | Technical Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[
<p>You can add where clause to a model like <strong>-&gt;where(</strong><em>/*condition*/</em><strong>)</strong></p>



<pre class="wp-block-code"><code>User::where('status' ,'=' ,1)->where('payment', '=' ,1)->get();</code></pre>



<p>Sometimes We need to add orWhere condition to our queries, between two cases. This might interfere with other conditions so we need to pass them in a function.</p>



<pre class="wp-block-code"><code>->where( function($query) {
	$query->where('parent_id', '=', 1)
              ->orWhere('parent_id','=' ,2);
} )</code></pre>



<center>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Fads -->
<ins class="adsbygoogle fads"
     style="display:inline-block;"
     data-ad-client="ca-pub-3804472713147276"
     data-ad-slot="1267368188"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
</center>




<p>To get external variables pass them with <strong>use</strong> </p>



<pre class="wp-block-code"><code>->where( function($query) use ($case1, $case2) {
	$query->where('parent_id', '=', $case1)
              ->orWhere('parent_id', '=' ,case2);
} )</code></pre>
<p>The post <a rel="nofollow" href="https://www.maxester.com/blog/2019/07/02/how-to-use-multiple-where-condition-in-laravel/">How to use multiple where condition in Laravel?</a> appeared first on <a rel="nofollow" href="https://www.maxester.com/blog">MaXEster Technologies  | Technical Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.maxester.com/blog/2019/07/02/how-to-use-multiple-where-condition-in-laravel/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to get IP Address of User in  PHP?</title>
		<link>https://www.maxester.com/blog/2019/04/29/how-to-get-ip-address-of-user-in-php/</link>
		<comments>https://www.maxester.com/blog/2019/04/29/how-to-get-ip-address-of-user-in-php/#respond</comments>
		<pubDate>Mon, 29 Apr 2019 13:16:27 +0000</pubDate>
		<dc:creator><![CDATA[Bhaskar Chaudhary]]></dc:creator>
				<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">https://www.maxester.com/blog/?p=373</guid>
		<description><![CDATA[<p>Php uses Global Variables (Superglobals) called $_SERVER to get the Header, Path, and Script Location. REMOTE_ADDR has the Ip address of the user on the current page.</p>
<p>The post <a rel="nofollow" href="https://www.maxester.com/blog/2019/04/29/how-to-get-ip-address-of-user-in-php/">How to get IP Address of User in  PHP?</a> appeared first on <a rel="nofollow" href="https://www.maxester.com/blog">MaXEster Technologies  | Technical Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[
<p>Php uses Global Variables (Superglobals) called $_SERVER to get the Header, Path, and Script Location.</p>



<p>REMOTE_ADDR has the Ip address of the user on the current page.</p>



<center>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Fads -->
<ins class="adsbygoogle fads"
     style="display:inline-block;"
     data-ad-client="ca-pub-3804472713147276"
     data-ad-slot="1267368188"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
</center>




<pre class="wp-block-code"><code>echo $_SERVER['REMOTE_ADDR'];</code></pre>



<p></p>
<p>The post <a rel="nofollow" href="https://www.maxester.com/blog/2019/04/29/how-to-get-ip-address-of-user-in-php/">How to get IP Address of User in  PHP?</a> appeared first on <a rel="nofollow" href="https://www.maxester.com/blog">MaXEster Technologies  | Technical Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.maxester.com/blog/2019/04/29/how-to-get-ip-address-of-user-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What References Do in PHP (&#038;)?</title>
		<link>https://www.maxester.com/blog/2019/04/27/what-references-do-in-php/</link>
		<comments>https://www.maxester.com/blog/2019/04/27/what-references-do-in-php/#respond</comments>
		<pubDate>Sat, 27 Apr 2019 09:05:56 +0000</pubDate>
		<dc:creator><![CDATA[Bhaskar Chaudhary]]></dc:creator>
				<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">https://www.maxester.com/blog/?p=370</guid>
		<description><![CDATA[<p>Makes Two variables refer to the same content. Hence, If you change one Other will too.</p>
<p>The post <a rel="nofollow" href="https://www.maxester.com/blog/2019/04/27/what-references-do-in-php/">What References Do in PHP (&#038;)?</a> appeared first on <a rel="nofollow" href="https://www.maxester.com/blog">MaXEster Technologies  | Technical Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[
<p>Makes Two variables refer to the same content. Hence, If you change one Other will too.</p>



<pre class="wp-block-code"><code>$a='some value';
$b='other value';

$a =&amp; $b; // assigning reference

echo $a.'&lt;br>'; //now $a has 'other value'

//if we change $a
$a = 'new value';

echo $b; //now $b is new 'value'</code></pre>



<center>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Fads -->
<ins class="adsbygoogle fads"
     style="display:inline-block;"
     data-ad-client="ca-pub-3804472713147276"
     data-ad-slot="1267368188"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>
</center>




<pre class="wp-block-code"><code>// OUTPUT

other value
new value</code></pre>
<p>The post <a rel="nofollow" href="https://www.maxester.com/blog/2019/04/27/what-references-do-in-php/">What References Do in PHP (&#038;)?</a> appeared first on <a rel="nofollow" href="https://www.maxester.com/blog">MaXEster Technologies  | Technical Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.maxester.com/blog/2019/04/27/what-references-do-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
