Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Find whether the type of a variable is string
<?php is_string(mixed $value): bool
<?php {
switch (true) {
case is_string($value):
$this->initFromString($value);
break;
<?php public function isFilePath()
{
if (is_string($this->data)) {
try {
return is_file($this->data);
} catch (\Exception $e) {
<?php public function isBinary()
{
if (is_string($this->data)) {
$mime = finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), $this->data);
return (substr($mime, 0, 4) != 'text' && $mime != 'application/x-empty');
}
<?php public function isBase64()
{
if (!is_string($this->data)) {
return false;
}
<?php private function decodeDataUrl($data_url)
{
if (!is_string($data_url)) {
return null;
}
<?php protected function hasApplicableFontFile()
{
if (is_string($this->file)) {
return file_exists($this->file);
}
<?php break;
case 'str':
case 'string':
$valid = \is_string($value);
$message = '%s accepts only string values as argument %d.';
break;
case 'array':
<?php if (is_null($away)) {
$away = ['top', 'right', 'bottom', 'left'];
} elseif (is_string($away)) {
$away = [$away];
}
<?php if ($this->hasApplicableFontFile()) {
if ($this->angle != 0 || is_string($this->align) || is_string($this->valign)) {
$box = $this->getBoxSize();
<?php private function createDriver()
{
if (is_string($this->config['driver'])) {
$drivername = ucfirst($this->config['driver']);
$driverclass = sprintf('Intervention\\Image\\%s\\Driver', $drivername);
<?php $config = $app['config'];
if (is_string($config->get('imagecache::route'))) {
$config->set('imagecache::templates.original', null);
<?php );
if (is_string(config('imagecache.route'))) {
$filename_pattern = '[ \w\\.\\/\\-\\@\(\)\=]+';
<?php if (is_null($away)) {
$away = ['top', 'right', 'bottom', 'left'];
} elseif (is_string($away)) {
$away = [$away];
}