Jump to content

Search the Community

Showing results for tags 'substr limit cher'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I'm having a problem with the following code My problem is i want to limit characters from $file, how can limit into not necessary for this file above but for every single file that is being echo $file I've tried to add it by my self but so far i do not understand it fully like this if ($rest = substr("$file", -1); <?php $count = 0; if ($handle = opendir('public')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." [color=#000000][color=#0000BB] if ($rest [/color][color=#007700]= [/color][color=#0000BB]substr[/color][color=#007700]([/color][color=#DD0000]"[/color][/color]$file[color=#000000][color=#DD0000]"[/color][color=#007700], -[/color][color=#0000BB]1[/color][color=#007700]);[/color][/color] && substr($file,-strlen(".html")) != ".html" //if you don't want to include .html files, for instance && substr($file,-strlen(".jpg")) != ".jpg" //if you don't want to include .js files, for instance && substr($file,-strlen(".sh")) != ".sh" //if you don't want to include .js files, for instance && substr($file,-strlen(".srt")) != ".srt" //if you don't want to include .js files, for instance && substr($file,-strlen(".sub")) != ".sub" //if you don't want to include .js files, for instance && substr($file,-strlen("subs")) != "subs" //if you don't want to include .js files, for instance && substr($file,-strlen("png")) != "png" //if you don't want to include .js files, for instance && $file != "" ) {$count++; print(" <div class=\"related\"><ul> <a href=\"http://$get_domain/play.php?url=http://$get_domain/public/$file\" title=\"$file\"><li> <img src=\"http://$get_domain/public/$file.png\" style=\"width:60px; height:50px; float:left; margin-right:6px; border:0;\"> $file<br /> <span class=\"detail\">5,432,128 views</span> </li></a> \n"); } } closedir($handle); } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.