<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: BANIYA MANI TEJA</title>
    <description>The latest articles on DEV Community by BANIYA MANI TEJA (@baniyamaniteja).</description>
    <link>https://dev.to/baniyamaniteja</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F661493%2Ff3e30c12-e422-455e-98de-b9ee25696b4a.png</url>
      <title>DEV Community: BANIYA MANI TEJA</title>
      <link>https://dev.to/baniyamaniteja</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/baniyamaniteja"/>
    <language>en</language>
    <item>
      <title>I Built a DSCR Calculator in Vanilla JavaScript — Here's the Loan Math Nobody Explains</title>
      <dc:creator>BANIYA MANI TEJA</dc:creator>
      <pubDate>Wed, 14 Oct 2026 18:34:03 +0000</pubDate>
      <link>https://dev.to/baniyamaniteja/i-built-a-dscr-calculator-in-vanilla-javascript-heres-the-loan-math-nobody-explains-272g</link>
      <guid>https://dev.to/baniyamaniteja/i-built-a-dscr-calculator-in-vanilla-javascript-heres-the-loan-math-nobody-explains-272g</guid>
      <description>&lt;p&gt;A while back I needed a DSCR calculator that wasn't buried under popups and didn't ask me to create an account before showing a single number. So I built one: a free, no-signup debt service coverage ratio calculator for rental property investors. It runs entirely in the browser.&lt;/p&gt;

&lt;p&gt;It sounded like a weekend project. The math had opinions.&lt;/p&gt;

&lt;p&gt;Here's what I learned, with the actual logic.&lt;/p&gt;

&lt;h2&gt;
  
  
  What DSCR actually is
&lt;/h2&gt;

&lt;p&gt;DSCR (debt service coverage ratio) answers one question: for every dollar of loan payment a rental property owes, how many dollars of operating income does it produce?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DSCR = Net Operating Income / Annual Debt Service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Net operating income (NOI)&lt;/strong&gt; = annual rent minus operating expenses (taxes, insurance, maintenance, management, vacancy). Not minus the mortgage — the mortgage is what we're measuring against.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Annual debt service&lt;/strong&gt; = the yearly loan payment, principal + interest.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A DSCR of 1.25 means the property produces $1.25 for every $1.00 of debt payment. Most investment-property lenders want to see 1.25x. Below 1.00, the property can't cover its own loan.&lt;/p&gt;

&lt;h2&gt;
  
  
  The amortization formula (the part everyone gets wrong)
&lt;/h2&gt;

&lt;p&gt;The monthly payment on a fixed-rate loan comes from the standard amortization formula:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;M = P * r(1+r)^n / ((1+r)^n - 1)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where P is principal, r is the &lt;em&gt;monthly&lt;/em&gt; rate, n is the number of payments. In code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;monthlyPayment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;principal&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;annualRatePct&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;years&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;annualRatePct&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;years&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;principal&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// edge case: 0% loans&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;factor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;principal&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;factor&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;factor&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That &lt;code&gt;r === 0&lt;/code&gt; guard matters. Without it, a 0% rate gives you 0/0 = NaN, and your calculator silently shows nothing. Real users &lt;em&gt;do&lt;/em&gt; type 0 — usually to model an all-cash scenario or a family loan.&lt;/p&gt;

&lt;h2&gt;
  
  
  Floating point money is a lie (so round deliberately)
&lt;/h2&gt;

&lt;p&gt;JavaScript's floating point will happily tell you a monthly payment is &lt;code&gt;4055.459999999999&lt;/code&gt;. For money, I round only at display time and keep full precision internally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;annualDebtService&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;monthlyPayment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;580000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;7.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// =&amp;gt; 48665.51...&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dscr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;62400&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;annualDebtService&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// =&amp;gt; 1.2824...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Display &lt;code&gt;1.28&lt;/code&gt;, compute with &lt;code&gt;1.2824&lt;/code&gt;. Rounding intermediate steps is how you get calculators that disagree with each other by a cent and erode trust.&lt;/p&gt;

&lt;h2&gt;
  
  
  The full calculation
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;calculateDSCR&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;annualRent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;operatingExpenses&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;loanAmount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;annualRatePct&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;years&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;noi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;annualRent&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;operatingExpenses&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;annualDebtService&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;monthlyPayment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;loanAmount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;annualRatePct&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;years&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;noi&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;annualDebtService&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;dscr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;noi&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;annualDebtService&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// $96k rent, $33.6k expenses, $580k at 7.5% for 30 years&lt;/span&gt;
&lt;span class="nf"&gt;calculateDSCR&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;annualRent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;96000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;operatingExpenses&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;33600&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;loanAmount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;580000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;annualRatePct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;7.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;years&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="c1"&gt;// =&amp;gt; { noi: 62400, annualDebtService: 48665.51, dscr: 1.2824 }&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The domain trap: two methods, one name
&lt;/h2&gt;

&lt;p&gt;The trickiest bug wasn't in the code — it was in the domain. There are &lt;strong&gt;two different DSCR methods&lt;/strong&gt;, and they give different answers on the same property:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;NOI method&lt;/strong&gt;: subtract operating expenses (including taxes and insurance) from income first, divide by principal + interest.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rent-over-PITIA method&lt;/strong&gt;: divide gross rent by PITIA (principal, interest, taxes, insurance, association dues). Nothing subtracted from income.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Same property, same loan, different ratios. I made the calculator use the NOI method and explain both, because investors who don't know the difference discover it mid-underwriting — when the deal is already under contract.&lt;/p&gt;

&lt;h2&gt;
  
  
  Working backwards: the feature users actually want
&lt;/h2&gt;

&lt;p&gt;The most useful thing the calculator does isn't computing DSCR from inputs — it's inverting the formula. Given a target DSCR (say 1.25), what's the maximum loan the property supports?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;maxLoan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;noi&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;targetDSCR&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;annualRatePct&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;years&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;maxAnnualPayment&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;noi&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="nx"&gt;targetDSCR&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;annualRatePct&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;years&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;factor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pow&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c1"&gt;// invert the amortization formula to solve for P&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;maxAnnualPayment&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;factor&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;factor&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;maxLoan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;62400&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;1.25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mf"&gt;7.5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// =&amp;gt; ~$594,953&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That number is the investor's negotiation ceiling. If the seller won't meet it, the math already said no.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lessons
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Guard your edge cases&lt;/strong&gt; — 0% rates, zero expenses, and empty inputs all produce NaN if you let them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Round at display, never in the pipeline&lt;/strong&gt; — intermediate rounding is how calculators disagree.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The domain is harder than the code&lt;/strong&gt; — the two-method trap took more research than the entire amortization implementation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Show your math&lt;/strong&gt; — every existing calculator I found hid its formula. Showing a worked example is what makes users trust the output.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The whole thing is a single HTML file with vanilla JavaScript — no framework, no build step, no backend. Financial data never leaves the browser, which is the entire point.&lt;/p&gt;

&lt;p&gt;Try it live: &lt;strong&gt;&lt;a href="https://dscrcalculatorpro.com/" rel="noopener noreferrer"&gt;DSCR Calculator&lt;/a&gt;&lt;/strong&gt; — free, no signup. And if you spot a math edge case I missed, I'd genuinely like to hear about it in the comments.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Scrape any website Using PHP code</title>
      <dc:creator>BANIYA MANI TEJA</dc:creator>
      <pubDate>Thu, 17 Feb 2022 21:12:43 +0000</pubDate>
      <link>https://dev.to/baniyamaniteja/scrape-any-website-using-php-code-5fgh</link>
      <guid>https://dev.to/baniyamaniteja/scrape-any-website-using-php-code-5fgh</guid>
      <description>&lt;p&gt;Im Scraping &lt;a href="https://momixapk.com"&gt;Momix apk&lt;/a&gt; Website.&lt;/p&gt;

&lt;p&gt;&amp;lt;?php&lt;/p&gt;

&lt;h1&gt;
  
  
  curl.php
&lt;/h1&gt;

&lt;p&gt;// Initialize a connection with cURL (ch = cURL handle, or "channel")&lt;br&gt;
$ch = curl_init();&lt;/p&gt;

&lt;p&gt;// Set the URL&lt;br&gt;
curl_setopt($ch, CURLOPT_URL, '&lt;a href="http://momixapk.com'"&gt;http://momixapk.com'&lt;/a&gt;);&lt;/p&gt;

&lt;p&gt;// Set the HTTP method&lt;br&gt;
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');&lt;/p&gt;

&lt;p&gt;// Return the response instead of printing it out&lt;br&gt;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);&lt;/p&gt;

&lt;p&gt;// Send the request and store the result in $response&lt;br&gt;
$response = curl_exec($ch);&lt;/p&gt;

&lt;p&gt;echo 'HTTP Status Code: ' . curl_getinfo($ch, CURLINFO_HTTP_CODE) . PHP_EOL;&lt;br&gt;
echo 'Response Body: ' . $response . PHP_EOL;&lt;/p&gt;

&lt;p&gt;// Close cURL resource to free up system resources&lt;br&gt;
curl_close($ch);&lt;/p&gt;

</description>
      <category>php</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Scrape any website Using PHP code</title>
      <dc:creator>BANIYA MANI TEJA</dc:creator>
      <pubDate>Sun, 26 Sep 2021 18:06:25 +0000</pubDate>
      <link>https://dev.to/baniyamaniteja/scrape-any-website-using-php-code-b81</link>
      <guid>https://dev.to/baniyamaniteja/scrape-any-website-using-php-code-b81</guid>
      <description>&lt;p&gt;Im Scraping &lt;a href="https://mtmanager.co"&gt;MT manager&lt;/a&gt; Website.&lt;/p&gt;

&lt;p&gt;&amp;lt;?php&lt;/p&gt;

&lt;h1&gt;
  
  
  curl.php
&lt;/h1&gt;

&lt;p&gt;// Initialize a connection with cURL (ch = cURL handle, or "channel")&lt;br&gt;
$ch = curl_init();&lt;/p&gt;

&lt;p&gt;// Set the URL&lt;br&gt;
curl_setopt($ch, CURLOPT_URL, '&lt;a href="http://mtmanager.co'"&gt;http://mtmanager.co'&lt;/a&gt;);&lt;/p&gt;

&lt;p&gt;// Set the HTTP method&lt;br&gt;
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');&lt;/p&gt;

&lt;p&gt;// Return the response instead of printing it out&lt;br&gt;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);&lt;/p&gt;

&lt;p&gt;// Send the request and store the result in $response&lt;br&gt;
$response = curl_exec($ch);&lt;/p&gt;

&lt;p&gt;echo 'HTTP Status Code: ' . curl_getinfo($ch, CURLINFO_HTTP_CODE) . PHP_EOL;&lt;br&gt;
echo 'Response Body: ' . $response . PHP_EOL;&lt;/p&gt;

&lt;p&gt;// Close cURL resource to free up system resources&lt;br&gt;
curl_close($ch);&lt;/p&gt;

</description>
      <category>php</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>PhP Curl Basic code to scrape</title>
      <dc:creator>BANIYA MANI TEJA</dc:creator>
      <pubDate>Sun, 04 Jul 2021 20:26:06 +0000</pubDate>
      <link>https://dev.to/baniyamaniteja/php-curl-basic-code-to-scrape-270d</link>
      <guid>https://dev.to/baniyamaniteja/php-curl-basic-code-to-scrape-270d</guid>
      <description>&lt;p&gt;curl_init() : initialize a cURL session.&lt;/p&gt;

&lt;p&gt;curl_setopt() : you can set all your options for the transfer.&lt;/p&gt;

&lt;p&gt;curl_exec() : you can execute the session.&lt;/p&gt;

&lt;p&gt;curl_close() : you finish off your session.&lt;/p&gt;

&lt;p&gt;Using Above 4 Function, I will fetch &lt;a href="https://movieboxpro.live"&gt;MovieBox Pro&lt;/a&gt; Website details.&lt;/p&gt;

&lt;p&gt;&amp;lt;?php&lt;br&gt;
$curl = curl_init();&lt;br&gt;
curl_setopt($curl, CURLOPT_URL, '&lt;a href="https://movieboxpro.live'"&gt;https://movieboxpro.live'&lt;/a&gt;);&lt;br&gt;
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);&lt;br&gt;
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);&lt;br&gt;
$result = curl_exec($curl);&lt;br&gt;
curl_close($curl);&lt;br&gt;
echo $result;&lt;br&gt;
?&amp;gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>codenewbie</category>
    </item>
  </channel>
</rss>
