PHP

All entries about PHP!
^Top
<< Back










Highlighted Entries

Sub Categories

URL Request Handling
String Operations

URL Request Handling

SEO Friendly URLs with PHP

Views: 746 Created: 2020-08-26 01:30:46 Modified: 2023-03-22 09:21:26
ModRewrite needs to be enabled in apache2 by executing:<br /> a2enmod rewrite Modify your HTaccess File like this if index.php is your main php File: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?i=$1 [L,QSA] &nbsp; For example, if the user enters the UR...

String Operations

Check if String exists in String

Views: 606 Created: 2020-11-07 16:04:34 Modified: 2023-03-27 00:02:59
&nbsp;Here code to check if a string exists in another string! $string = &#39;This is a String&#39;;<br /> if (strpos($string , &#39;This&#39;) !== false) {<br /> &nbsp;&nbsp;&nbsp; echo &#39;true&#39;; # STRING CONTAINS WORD &quot;This&quot;<br /> } else {<br /> # String not f...

Replace in a String

Views: 627 Created: 2020-11-07 16:02:41 Modified: 2023-03-27 15:13:48
Example of replacing a sign in a string (works with more than one sign) &nbsp; $newstring = str_replace(&quot;TEXT&quot;, &quot;NEW TEXT&quot;, $initialstring); ...

This Website is using Session Cookies for Site Functionality.